version app + node.exe + nw.exe
This commit is contained in:
153
node_modules/sqlite3/CHANGELOG.md
generated
vendored
Normal file
153
node_modules/sqlite3/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,153 @@
|
||||
# Changelog
|
||||
|
||||
## 3.1.0
|
||||
|
||||
- Support for node 3.x and 4.x
|
||||
- Stopped producing binaries for node-webkit and 32 bit linux
|
||||
|
||||
## 3.0.11
|
||||
|
||||
- Support for io.js 3.x (upgrade to Nan 2.x) @kkoopa
|
||||
|
||||
## 3.0.10
|
||||
|
||||
- Upgraded SQLite to 3.8.11.1: https://www.sqlite.org/releaselog/3_8_11_1.html
|
||||
- Fixed binary compatibility regression with old centos/rhel glibc GLIBC_2.14 (re-introduced alpine linux (musl) build regression)
|
||||
- Now providing binaries against Visual Studio 2015 (pass --toolset=v140) and use binaries from https://github.com/mapbox/node-cpp11
|
||||
|
||||
## 3.0.9
|
||||
|
||||
- Fixed build regression against alpine linux (musl)
|
||||
- Upgraded node-pre-gyp@0.6.8
|
||||
|
||||
## 3.0.8
|
||||
|
||||
- Fixed build regression against FreeBSD
|
||||
- Upgraded node-pre-gyp@0.6.7
|
||||
|
||||
## 3.0.7
|
||||
|
||||
- Fixed build regression against ARM and i386 linux
|
||||
- Upgraded node-pre-gyp@0.6.6
|
||||
- Added support for io.js 2.0.0
|
||||
|
||||
## 3.0.6
|
||||
|
||||
- Upgraded node-pre-gyp@0.6.5
|
||||
- Upgraded nan@1.8.4
|
||||
- Fixed binaries to work on older linux systems (circa GLIBC_2.2.5 like centos 6) @bnoordhuis
|
||||
- Updated internal libsqlite3 from 3.8.7.1 -> 3.8.9 (http://www.sqlite.org/news.html)
|
||||
|
||||
## 3.0.5
|
||||
|
||||
- IO.js and Node v0.12.x support.
|
||||
- Node-webkit v0.11.x support regressed in this release, sorry (https://github.com/mapbox/node-sqlite3/issues/404).
|
||||
|
||||
## 3.0.4
|
||||
|
||||
- Upgraded node-pre-gyp@0.6.1
|
||||
|
||||
## 3.0.3
|
||||
|
||||
- Upgraded to node-pre-gyp@0.6.0 which should fix crashes against node v0.11.14
|
||||
- Now providing binaries against Visual Studio 2014 (pass --toolset=v140) and use binaries from https://github.com/mapbox/node-cpp11
|
||||
|
||||
## 3.0.2
|
||||
|
||||
- Republish for possibly busted npm package.
|
||||
|
||||
## 3.0.1
|
||||
|
||||
- Use ~ in node-pre-gyp semver for more flexible dep management.
|
||||
|
||||
## 3.0.0
|
||||
|
||||
Released September 20nd, 2014
|
||||
|
||||
- Backwards-incompatible change: node versions 0.8.x are no longer supported.
|
||||
- Updated to node-pre-gyp@0.5.27
|
||||
- Updated NAN to 1.3.0
|
||||
- Updated internal libsqlite3 to v3.8.6
|
||||
|
||||
## 2.2.7
|
||||
|
||||
Released August 6th, 2014
|
||||
|
||||
- Removed usage of `npm ls` with `prepublish` target (which breaks node v0.8.x)
|
||||
|
||||
## 2.2.6
|
||||
|
||||
Released August 6th, 2014
|
||||
|
||||
- Fix bundled version of node-pre-gyp
|
||||
|
||||
## 2.2.5
|
||||
|
||||
Released August 5th, 2014
|
||||
|
||||
- Fix leak in complete() callback of Database.each() (#307)
|
||||
- Started using `engineStrict` and improved `engines` declaration to make clear only >= 0.11.13 is supported for the 0.11.x series.
|
||||
|
||||
## 2.2.4
|
||||
|
||||
Released July 14th, 2014
|
||||
|
||||
- Now supporting node v0.11.x (specifically >=0.11.13)
|
||||
- Fix db opening error with absolute path on windows
|
||||
- Updated to node-pre-gyp@0.5.18
|
||||
- updated internal libsqlite3 from 3.8.4.3 -> 3.8.5 (http://www.sqlite.org/news.html)
|
||||
|
||||
## 2.2.3
|
||||
|
||||
- Fixed regression in v2.2.2 for installing from binaries on windows.
|
||||
|
||||
## 2.2.2
|
||||
|
||||
- Fixed packaging problem whereby a `config.gypi` was unintentially packaged and could cause breakages for OS X builds.
|
||||
|
||||
## 2.2.1
|
||||
|
||||
- Now shipping with 64bit FreeBSD binaries against both node v0.10.x and node v0.8.x.
|
||||
- Fixed solaris/smartos source compile by passing `-std=c99` when building internally bundled libsqlite3 (#201)
|
||||
- Reduced size of npm package by ignoring tests and examples.
|
||||
- Various fixes and improvements for building against node-webkit
|
||||
- Upgraded to node-pre-gyp@0.5.x from node-pre-gyp@0.2.5
|
||||
- Improved ability to build from source against `sqlcipher` by passing custom library name: `--sqlite_libname=sqlcipher`
|
||||
- No changes to C++ Core / Existing binaries are exactly the same
|
||||
|
||||
## 2.2.0
|
||||
|
||||
Released Jan 13th, 2014
|
||||
|
||||
- updated internal libsqlite3 from 3.7.17 -> 3.8.2 (http://www.sqlite.org/news.html) which includes the next-generation query planner http://www.sqlite.org/queryplanner-ng.html
|
||||
- improved binary deploy system using https://github.com/springmeyer/node-pre-gyp
|
||||
- binary install now supports http proxies
|
||||
- source compile now supports freebsd
|
||||
- fixed support for node-webkit
|
||||
|
||||
## 2.1.19
|
||||
|
||||
Released October 31st, 2013
|
||||
|
||||
- Started respecting `process.env.npm_config_tmp` as location to download binaries
|
||||
- Removed uneeded `progress` dependency
|
||||
|
||||
## 2.1.18
|
||||
|
||||
Released October 22nd, 2013
|
||||
|
||||
- `node-sqlite3` moved to mapbox github group
|
||||
- Fixed reporting of node-gyp errors
|
||||
- Fixed support for node v0.6.x
|
||||
|
||||
## 2.1.17
|
||||
- Minor fixes to binary deployment
|
||||
|
||||
## 2.1.16
|
||||
- Support for binary deployment
|
||||
|
||||
## 2.1.15
|
||||
|
||||
Released August 7th, 2013
|
||||
|
||||
- Minor readme additions and code optimizations
|
||||
25
node_modules/sqlite3/LICENSE
generated
vendored
Normal file
25
node_modules/sqlite3/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
Copyright (c) MapBox
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright notice, this
|
||||
list of conditions and the following disclaimer in the documentation and/or
|
||||
other materials provided with the distribution.
|
||||
- Neither the name "MapBox" nor the names of its contributors may be
|
||||
used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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.
|
||||
210
node_modules/sqlite3/README.md
generated
vendored
Normal file
210
node_modules/sqlite3/README.md
generated
vendored
Normal file
@@ -0,0 +1,210 @@
|
||||
Asynchronous, non-blocking [SQLite3](http://sqlite.org/) bindings for [Node.js](http://nodejs.org/).
|
||||
|
||||
[](https://nodei.co/npm/sqlite3/)
|
||||
|
||||
[](https://travis-ci.org/mapbox/node-sqlite3)
|
||||
[](https://ci.appveyor.com/project/Mapbox/node-sqlite3)
|
||||
[](https://david-dm.org/mapbox/node-sqlite3)
|
||||
|
||||
|
||||
## Supported platforms
|
||||
|
||||
The `sqlite3` module works with Node.js v0.10.x or v0.12.x and io.js v1.x or 2.x.
|
||||
|
||||
Binaries for most Node versions and platforms are provided by default via [node-pre-gyp](https://github.com/mapbox/node-pre-gyp).
|
||||
|
||||
The `sqlite3` module also works with [node-webkit](https://github.com/rogerwang/node-webkit) if node-webkit contains a supported version of Node.js engine. [(See below.)](#building-for-node-webkit)
|
||||
|
||||
SQLite's [SQLCipher extension](https://github.com/sqlcipher/sqlcipher) is also supported. [(See below.)](#building-for-sqlcipher)
|
||||
|
||||
# Usage
|
||||
|
||||
**Note:** the module must be [installed](#installing) before use.
|
||||
|
||||
``` js
|
||||
var sqlite3 = require('sqlite3').verbose();
|
||||
var db = new sqlite3.Database(':memory:');
|
||||
|
||||
db.serialize(function() {
|
||||
db.run("CREATE TABLE lorem (info TEXT)");
|
||||
|
||||
var stmt = db.prepare("INSERT INTO lorem VALUES (?)");
|
||||
for (var i = 0; i < 10; i++) {
|
||||
stmt.run("Ipsum " + i);
|
||||
}
|
||||
stmt.finalize();
|
||||
|
||||
db.each("SELECT rowid AS id, info FROM lorem", function(err, row) {
|
||||
console.log(row.id + ": " + row.info);
|
||||
});
|
||||
});
|
||||
|
||||
db.close();
|
||||
```
|
||||
|
||||
# Features
|
||||
|
||||
- Straightforward query and parameter binding interface
|
||||
- Full Buffer/Blob support
|
||||
- Extensive [debugging support](https://github.com/mapbox/node-sqlite3/wiki/Debugging)
|
||||
- [Query serialization](https://github.com/mapbox/node-sqlite3/wiki/Control-Flow) API
|
||||
- [Extension support](https://github.com/mapbox/node-sqlite3/wiki/Extensions)
|
||||
- Big test suite
|
||||
- Written in modern C++ and tested for memory leaks
|
||||
|
||||
|
||||
# API
|
||||
|
||||
See the [API documentation](https://github.com/mapbox/node-sqlite3/wiki) in the wiki.
|
||||
|
||||
|
||||
# Installing
|
||||
|
||||
You can use [`npm`](https://github.com/isaacs/npm) to download and install:
|
||||
|
||||
* The latest `sqlite3` package: `npm install sqlite3`
|
||||
|
||||
* GitHub's `master` branch: `npm install https://github.com/mapbox/node-sqlite3/tarball/master`
|
||||
|
||||
In both cases the module is automatically built with npm's internal version of `node-gyp`,
|
||||
and thus your system must meet [node-gyp's requirements](https://github.com/TooTallNate/node-gyp#installation).
|
||||
|
||||
It is also possible to make your own build of `sqlite3` from its source instead of its npm package ([see below](#building-from-the-source)).
|
||||
|
||||
It is possible to use the installed package in [node-webkit](https://github.com/rogerwang/node-webkit) instead of the vanilla Node.js. See [Building for node-webkit](#building-for-node-webkit) for details.
|
||||
|
||||
## Source install
|
||||
|
||||
Unless building via `npm install` (which uses its own `node-gyp`) you will need `node-gyp` installed globally:
|
||||
|
||||
npm install node-gyp -g
|
||||
|
||||
The sqlite3 module depends only on libsqlite3. However, by default, an internal/bundled copy of sqlite will be built and statically linked, so an externally installed sqlite3 is not required.
|
||||
|
||||
If you wish to install against an external sqlite then you need to pass the `--sqlite` argument to `node-gyp`, `npm install` or the `configure` wrapper.
|
||||
|
||||
./configure --sqlite=/usr/local
|
||||
make
|
||||
|
||||
Or, using the node-gyp directly:
|
||||
|
||||
node-gyp --sqlite=/usr/local
|
||||
make
|
||||
|
||||
Or, using npm:
|
||||
|
||||
npm install --sqlite=/usr/local
|
||||
|
||||
If building against an external sqlite3 make sure to have the development headers available. Mac OS X ships with these by default. If you don't have them installed, install the `-dev` package with your package manager, e.g. `apt-get install libsqlite3-dev` for Debian/Ubuntu. Make sure that you have at least `libsqlite3` >= 3.6.
|
||||
|
||||
Note, if building against homebrew-installed sqlite on OS X you can do:
|
||||
|
||||
./configure --sqlite=/usr/local/opt/sqlite/
|
||||
make
|
||||
|
||||
## Building for node-webkit
|
||||
|
||||
Because of ABI differences, `sqlite3` must be built in a custom to be used with [node-webkit](https://github.com/rogerwang/node-webkit).
|
||||
|
||||
To build node-sqlite3 for node-webkit:
|
||||
|
||||
1. Install [`nw-gyp`](https://github.com/rogerwang/nw-gyp) globally: `npm install nw-gyp -g` *(unless already installed)*
|
||||
|
||||
2. Build the module with the custom flags of `--runtime`, `--target_arch`, and `--target`:
|
||||
|
||||
```sh
|
||||
NODE_WEBKIT_VERSION="0.8.6" # see latest version at https://github.com/rogerwang/node-webkit#downloads
|
||||
npm install sqlite3 --build-from-source --runtime=node-webkit --target_arch=ia32 --target=$(NODE_WEBKIT_VERSION)
|
||||
```
|
||||
|
||||
This command internally calls out to [`node-pre-gyp`](https://github.com/mapbox/node-pre-gyp) which itself calls out to [`nw-gyp`](https://github.com/rogerwang/nw-gyp) when the `--runtime=node-webkit` option is passed.
|
||||
|
||||
You can also run this command from within a `node-sqlite3` checkout:
|
||||
|
||||
```sh
|
||||
npm install --build-from-source --runtime=node-webkit --target_arch=ia32 --target=$(NODE_WEBKIT_VERSION)
|
||||
```
|
||||
|
||||
Remember the following:
|
||||
|
||||
* You must provide the right `--target_arch` flag. `ia32` is needed to target 32bit node-webkit builds, while `x64` will target 64bit node-webkit builds (if available for your platform).
|
||||
|
||||
* After the `sqlite3` package is built for node-webkit it cannot run in the vanilla Node.js (and vice versa).
|
||||
* For example, `npm test` of the node-webkit's package would fail.
|
||||
|
||||
Visit the “[Using Node modules](https://github.com/rogerwang/node-webkit/wiki/Using-Node-modules)” article in the node-webkit's wiki for more details.
|
||||
|
||||
## Building for sqlcipher
|
||||
|
||||
For instructions for building sqlcipher see
|
||||
[Building SQLCipher for node.js](https://coolaj86.com/articles/building-sqlcipher-for-node-js-on-raspberry-pi-2/)
|
||||
|
||||
To run node-sqlite3 against sqlcipher you need to compile from source by passing build options like:
|
||||
|
||||
npm install sqlite3 --build-from-source --sqlite_libname=sqlcipher --sqlite=/usr/
|
||||
|
||||
node -e 'require("sqlite3")'
|
||||
|
||||
If your sqlcipher is installed in a custom location (if you compiled and installed it yourself),
|
||||
you'll also need to to set some environment variables:
|
||||
|
||||
### On OS X with Homebrew
|
||||
|
||||
Set the location where `brew` installed it:
|
||||
|
||||
export LDFLAGS="-L`brew --prefix`/opt/sqlcipher/lib"
|
||||
export CPPFLAGS="-I`brew --prefix`/opt/sqlcipher/include"
|
||||
npm install sqlite3 --build-from-source --sqlite_libname=sqlcipher --sqlite=`brew --prefix`
|
||||
|
||||
node -e 'require("sqlite3")'
|
||||
|
||||
### On most Linuxes (including Raspberry Pi)
|
||||
|
||||
Set the location where `make` installed it:
|
||||
|
||||
export LDFLAGS="-L/usr/local/lib"
|
||||
export CPPFLAGS="-I/usr/local/include -I/usr/local/include/sqlcipher"
|
||||
export CXXFLAGS="$CPPFLAGS"
|
||||
npm install sqlite3 --build-from-source --sqlite_libname=sqlcipher --sqlite=/usr/local --verbose
|
||||
|
||||
node -e 'require("sqlite3")'
|
||||
|
||||
# Testing
|
||||
|
||||
[mocha](https://github.com/visionmedia/mocha) is required to run unit tests.
|
||||
|
||||
In sqlite3's directory (where its `package.json` resides) run the following:
|
||||
|
||||
npm install mocha
|
||||
npm test
|
||||
|
||||
|
||||
# Contributors
|
||||
|
||||
* [Konstantin Käfer](https://github.com/kkaefer)
|
||||
* [Dane Springmeyer](https://github.com/springmeyer)
|
||||
* [Will White](https://github.com/willwhite)
|
||||
* [Orlando Vazquez](https://github.com/orlandov)
|
||||
* [Artem Kustikov](https://github.com/artiz)
|
||||
* [Eric Fredricksen](https://github.com/grumdrig)
|
||||
* [John Wright](https://github.com/mrjjwright)
|
||||
* [Ryan Dahl](https://github.com/ry)
|
||||
* [Tom MacWright](https://github.com/tmcw)
|
||||
* [Carter Thaxton](https://github.com/carter-thaxton)
|
||||
* [Audrius Kažukauskas](https://github.com/audriusk)
|
||||
* [Johannes Schauer](https://github.com/pyneo)
|
||||
* [Mithgol](https://github.com/Mithgol)
|
||||
|
||||
|
||||
# Acknowledgments
|
||||
|
||||
Thanks to [Orlando Vazquez](https://github.com/orlandov),
|
||||
[Eric Fredricksen](https://github.com/grumdrig) and
|
||||
[Ryan Dahl](https://github.com/ry) for their SQLite bindings for node, and to mraleph on Freenode's #v8 for answering questions.
|
||||
|
||||
Development of this module is sponsored by [MapBox](http://mapbox.org/).
|
||||
|
||||
|
||||
# License
|
||||
|
||||
`node-sqlite3` is [BSD licensed](https://github.com/mapbox/node-sqlite3/raw/master/LICENSE).
|
||||
62
node_modules/sqlite3/appveyor.yml
generated
vendored
Normal file
62
node_modules/sqlite3/appveyor.yml
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
environment:
|
||||
node_pre_gyp_accessKeyId:
|
||||
secure: 7DrSVc5eIGtmMcki5H+iRft+Tk3MJTwDBQEUuJHWaQ4=
|
||||
node_pre_gyp_secretAccessKey:
|
||||
secure: 1amwJJw9fu0j6dXnc5KsAQbSYf7Cjw/dapT6OZWABa6nc52grkKeLQ+DGaOfQz8i
|
||||
matrix:
|
||||
- nodejs_version: 0.10.40
|
||||
platform: x86
|
||||
msvs_toolset: 12
|
||||
- nodejs_version: 0.10.40
|
||||
platform: x64
|
||||
msvs_toolset: 12
|
||||
- nodejs_version: 0.12.7
|
||||
platform: x86
|
||||
msvs_toolset: 12
|
||||
- nodejs_version: 0.12.7
|
||||
platform: x64
|
||||
msvs_toolset: 12
|
||||
- nodejs_version: 1.8.1
|
||||
platform: x86
|
||||
msvs_toolset: 12
|
||||
- nodejs_version: 1.8.1
|
||||
platform: x64
|
||||
msvs_toolset: 12
|
||||
- nodejs_version: 2.0.0
|
||||
platform: x64
|
||||
msvs_toolset: 12
|
||||
- nodejs_version: 2.0.0
|
||||
platform: x86
|
||||
msvs_toolset: 12
|
||||
- nodejs_version: 3.3.0
|
||||
platform: x64
|
||||
msvs_toolset: 12
|
||||
- nodejs_version: 3.3.0
|
||||
platform: x86
|
||||
msvs_toolset: 12
|
||||
# custom visual studio 2015 builds
|
||||
- nodejs_version: 0.10.40
|
||||
platform: x86
|
||||
msvs_toolset: 14
|
||||
TOOLSET_ARGS: --dist-url=https://s3.amazonaws.com/mapbox/node-cpp11 --toolset=v140
|
||||
- nodejs_version: 0.10.40
|
||||
platform: x64
|
||||
msvs_toolset: 14
|
||||
TOOLSET_ARGS: --dist-url=https://s3.amazonaws.com/mapbox/node-cpp11 --toolset=v140
|
||||
- nodejs_version: 0.12.7
|
||||
platform: x86
|
||||
msvs_toolset: 14
|
||||
TOOLSET_ARGS: --dist-url=https://s3.amazonaws.com/mapbox/node-cpp11 --toolset=v140
|
||||
- nodejs_version: 0.12.7
|
||||
platform: x64
|
||||
msvs_toolset: 14
|
||||
TOOLSET_ARGS: --dist-url=https://s3.amazonaws.com/mapbox/node-cpp11 --toolset=v140
|
||||
|
||||
os: Visual Studio 2015
|
||||
|
||||
install:
|
||||
- scripts\build-appveyor.bat
|
||||
|
||||
build: OFF
|
||||
test: OFF
|
||||
deploy: OFF
|
||||
53
node_modules/sqlite3/binding.gyp
generated
vendored
Normal file
53
node_modules/sqlite3/binding.gyp
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
{
|
||||
"includes": [ "deps/common-sqlite.gypi" ],
|
||||
"variables": {
|
||||
"sqlite%":"internal",
|
||||
"sqlite_libname%":"sqlite3"
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"target_name": "<(module_name)",
|
||||
"include_dirs": ["<!(node -e \"require('nan')\")"],
|
||||
"conditions": [
|
||||
["sqlite != 'internal'", {
|
||||
"include_dirs": [ "<(sqlite)/include" ],
|
||||
"libraries": [
|
||||
"-l<(sqlite_libname)"
|
||||
],
|
||||
"conditions": [ [ "OS=='linux'", {"libraries+":["-Wl,-rpath=<@(sqlite)/lib"]} ] ],
|
||||
"conditions": [ [ "OS!='win'", {"libraries+":["-L<@(sqlite)/lib"]} ] ],
|
||||
'msvs_settings': {
|
||||
'VCLinkerTool': {
|
||||
'AdditionalLibraryDirectories': [
|
||||
'<(sqlite)/lib'
|
||||
],
|
||||
},
|
||||
}
|
||||
},
|
||||
{
|
||||
"dependencies": [
|
||||
"deps/sqlite3.gyp:sqlite3"
|
||||
]
|
||||
}
|
||||
]
|
||||
],
|
||||
"cflags": [ "-include ../src/gcc-preinclude.h" ],
|
||||
"sources": [
|
||||
"src/database.cc",
|
||||
"src/node_sqlite3.cc",
|
||||
"src/statement.cc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target_name": "action_after_build",
|
||||
"type": "none",
|
||||
"dependencies": [ "<(module_name)" ],
|
||||
"copies": [
|
||||
{
|
||||
"files": [ "<(PRODUCT_DIR)/<(module_name).node" ],
|
||||
"destination": "<(module_path)"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
56
node_modules/sqlite3/deps/common-sqlite.gypi
generated
vendored
Normal file
56
node_modules/sqlite3/deps/common-sqlite.gypi
generated
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
{
|
||||
'variables': {
|
||||
'sqlite_version%':'3081101',
|
||||
"toolset%":'',
|
||||
},
|
||||
'target_defaults': {
|
||||
'default_configuration': 'Release',
|
||||
'msbuild_toolset':'<(toolset)',
|
||||
'configurations': {
|
||||
'Debug': {
|
||||
'defines!': [
|
||||
'NDEBUG'
|
||||
],
|
||||
'cflags_cc!': [
|
||||
'-O3',
|
||||
'-Os',
|
||||
'-DNDEBUG'
|
||||
],
|
||||
'xcode_settings': {
|
||||
'OTHER_CPLUSPLUSFLAGS!': [
|
||||
'-O3',
|
||||
'-Os',
|
||||
'-DDEBUG'
|
||||
],
|
||||
'GCC_OPTIMIZATION_LEVEL': '0',
|
||||
'GCC_GENERATE_DEBUGGING_SYMBOLS': 'YES'
|
||||
},
|
||||
'msvs_settings': {
|
||||
'VCCLCompilerTool': {
|
||||
'ExceptionHandling': 1, # /EHsc
|
||||
}
|
||||
}
|
||||
},
|
||||
'Release': {
|
||||
'defines': [
|
||||
'NDEBUG'
|
||||
],
|
||||
'xcode_settings': {
|
||||
'OTHER_CPLUSPLUSFLAGS!': [
|
||||
'-Os',
|
||||
'-O2'
|
||||
],
|
||||
'GCC_OPTIMIZATION_LEVEL': '3',
|
||||
'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
|
||||
'DEAD_CODE_STRIPPING': 'YES',
|
||||
'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES'
|
||||
},
|
||||
'msvs_settings': {
|
||||
'VCCLCompilerTool': {
|
||||
'ExceptionHandling': 1, # /EHsc
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
9
node_modules/sqlite3/deps/extract.py
generated
vendored
Normal file
9
node_modules/sqlite3/deps/extract.py
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import sys
|
||||
import tarfile
|
||||
import os
|
||||
|
||||
tarball = os.path.abspath(sys.argv[1])
|
||||
dirname = os.path.abspath(sys.argv[2])
|
||||
tfile = tarfile.open(tarball,'r:gz');
|
||||
tfile.extractall(dirname)
|
||||
sys.exit(0)
|
||||
BIN
node_modules/sqlite3/deps/sqlite-autoconf-3081101.tar.gz
generated
vendored
Normal file
BIN
node_modules/sqlite3/deps/sqlite-autoconf-3081101.tar.gz
generated
vendored
Normal file
Binary file not shown.
101
node_modules/sqlite3/deps/sqlite3.gyp
generated
vendored
Normal file
101
node_modules/sqlite3/deps/sqlite3.gyp
generated
vendored
Normal file
@@ -0,0 +1,101 @@
|
||||
{
|
||||
'includes': [ 'common-sqlite.gypi' ],
|
||||
'target_defaults': {
|
||||
'default_configuration': 'Release',
|
||||
'cflags':[
|
||||
'-std=c99'
|
||||
],
|
||||
'configurations': {
|
||||
'Debug': {
|
||||
'defines': [ 'DEBUG', '_DEBUG' ],
|
||||
'msvs_settings': {
|
||||
'VCCLCompilerTool': {
|
||||
'RuntimeLibrary': 1, # static debug
|
||||
},
|
||||
},
|
||||
},
|
||||
'Release': {
|
||||
'defines': [ 'NDEBUG' ],
|
||||
'msvs_settings': {
|
||||
'VCCLCompilerTool': {
|
||||
'RuntimeLibrary': 0, # static release
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
'msvs_settings': {
|
||||
'VCCLCompilerTool': {
|
||||
},
|
||||
'VCLibrarianTool': {
|
||||
},
|
||||
'VCLinkerTool': {
|
||||
'GenerateDebugInformation': 'true',
|
||||
},
|
||||
},
|
||||
'conditions': [
|
||||
['OS == "win"', {
|
||||
'defines': [
|
||||
'WIN32'
|
||||
],
|
||||
}]
|
||||
],
|
||||
},
|
||||
|
||||
'targets': [
|
||||
{
|
||||
'target_name': 'action_before_build',
|
||||
'type': 'none',
|
||||
'hard_dependency': 1,
|
||||
'actions': [
|
||||
{
|
||||
'action_name': 'unpack_sqlite_dep',
|
||||
'inputs': [
|
||||
'./sqlite-autoconf-<@(sqlite_version).tar.gz'
|
||||
],
|
||||
'outputs': [
|
||||
'<(SHARED_INTERMEDIATE_DIR)/sqlite-autoconf-<@(sqlite_version)/sqlite3.c'
|
||||
],
|
||||
'action': ['python','./extract.py','./sqlite-autoconf-<@(sqlite_version).tar.gz','<(SHARED_INTERMEDIATE_DIR)']
|
||||
}
|
||||
],
|
||||
'direct_dependent_settings': {
|
||||
'include_dirs': [
|
||||
'<(SHARED_INTERMEDIATE_DIR)/sqlite-autoconf-<@(sqlite_version)/',
|
||||
]
|
||||
},
|
||||
},
|
||||
{
|
||||
'target_name': 'sqlite3',
|
||||
'type': 'static_library',
|
||||
'include_dirs': [ '<(SHARED_INTERMEDIATE_DIR)/sqlite-autoconf-<@(sqlite_version)/' ],
|
||||
'dependencies': [
|
||||
'action_before_build'
|
||||
],
|
||||
'cflags': [ '-include ../src/gcc-preinclude.h' ],
|
||||
'sources': [
|
||||
'<(SHARED_INTERMEDIATE_DIR)/sqlite-autoconf-<@(sqlite_version)/sqlite3.c'
|
||||
],
|
||||
'direct_dependent_settings': {
|
||||
'include_dirs': [ '<(SHARED_INTERMEDIATE_DIR)/sqlite-autoconf-<@(sqlite_version)/' ],
|
||||
'defines': [
|
||||
'SQLITE_THREADSAFE=1',
|
||||
'SQLITE_ENABLE_FTS3',
|
||||
'SQLITE_ENABLE_RTREE'
|
||||
],
|
||||
},
|
||||
'cflags_cc': [
|
||||
'-Wno-unused-value',
|
||||
'-include ../src/gcc-preinclude.h'
|
||||
],
|
||||
'defines': [
|
||||
'_REENTRANT=1',
|
||||
'SQLITE_THREADSAFE=1',
|
||||
'SQLITE_ENABLE_FTS3',
|
||||
'SQLITE_ENABLE_RTREE'
|
||||
],
|
||||
'export_dependent_settings': [
|
||||
'action_before_build',
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
BIN
node_modules/sqlite3/lib/binding/node-v14-win32-x64/node_sqlite3.node
generated
vendored
Normal file
BIN
node_modules/sqlite3/lib/binding/node-v14-win32-x64/node_sqlite3.node
generated
vendored
Normal file
Binary file not shown.
1
node_modules/sqlite3/lib/index.js
generated
vendored
Normal file
1
node_modules/sqlite3/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
module.exports = require('./sqlite3');
|
||||
187
node_modules/sqlite3/lib/sqlite3.js
generated
vendored
Normal file
187
node_modules/sqlite3/lib/sqlite3.js
generated
vendored
Normal file
@@ -0,0 +1,187 @@
|
||||
var binary = require('node-pre-gyp');
|
||||
var path = require('path');
|
||||
var binding_path = binary.find(path.resolve(path.join(__dirname,'../package.json')));
|
||||
var binding = require(binding_path);
|
||||
var sqlite3 = module.exports = exports = binding;
|
||||
var EventEmitter = require('events').EventEmitter;
|
||||
|
||||
function normalizeMethod (fn) {
|
||||
return function (sql) {
|
||||
var errBack;
|
||||
var args = Array.prototype.slice.call(arguments, 1);
|
||||
if (typeof args[args.length - 1] === 'function') {
|
||||
var callback = args[args.length - 1];
|
||||
errBack = function(err) {
|
||||
if (err) {
|
||||
callback(err);
|
||||
}
|
||||
};
|
||||
}
|
||||
var statement = new Statement(this, sql, errBack);
|
||||
return fn.call(this, statement, args);
|
||||
}
|
||||
}
|
||||
|
||||
function inherits(target, source) {
|
||||
for (var k in source.prototype)
|
||||
target.prototype[k] = source.prototype[k];
|
||||
}
|
||||
|
||||
sqlite3.cached = {
|
||||
Database: function(file, a, b) {
|
||||
if (file === '' || file === ':memory:') {
|
||||
// Don't cache special databases.
|
||||
return new Database(file, a, b);
|
||||
}
|
||||
|
||||
file = path.resolve(file);
|
||||
|
||||
if (!sqlite3.cached.objects[file]) {
|
||||
var db =sqlite3.cached.objects[file] = new Database(file, a, b);
|
||||
}
|
||||
else {
|
||||
// Make sure the callback is called.
|
||||
var db = sqlite3.cached.objects[file];
|
||||
var callback = (typeof a === 'number') ? b : a;
|
||||
if (typeof callback === 'function') {
|
||||
function cb() { callback.call(db, null); }
|
||||
if (db.open) process.nextTick(cb);
|
||||
else db.once('open', cb);
|
||||
}
|
||||
}
|
||||
|
||||
return db;
|
||||
},
|
||||
objects: {}
|
||||
};
|
||||
|
||||
|
||||
var Database = sqlite3.Database;
|
||||
var Statement = sqlite3.Statement;
|
||||
|
||||
inherits(Database, EventEmitter);
|
||||
inherits(Statement, EventEmitter);
|
||||
|
||||
// Database#prepare(sql, [bind1, bind2, ...], [callback])
|
||||
Database.prototype.prepare = normalizeMethod(function(statement, params) {
|
||||
return params.length
|
||||
? statement.bind.apply(statement, params)
|
||||
: statement;
|
||||
});
|
||||
|
||||
// Database#run(sql, [bind1, bind2, ...], [callback])
|
||||
Database.prototype.run = normalizeMethod(function(statement, params) {
|
||||
statement.run.apply(statement, params).finalize();
|
||||
return this;
|
||||
});
|
||||
|
||||
// Database#get(sql, [bind1, bind2, ...], [callback])
|
||||
Database.prototype.get = normalizeMethod(function(statement, params) {
|
||||
statement.get.apply(statement, params).finalize();
|
||||
return this;
|
||||
});
|
||||
|
||||
// Database#all(sql, [bind1, bind2, ...], [callback])
|
||||
Database.prototype.all = normalizeMethod(function(statement, params) {
|
||||
statement.all.apply(statement, params).finalize();
|
||||
return this;
|
||||
});
|
||||
|
||||
// Database#each(sql, [bind1, bind2, ...], [callback], [complete])
|
||||
Database.prototype.each = normalizeMethod(function(statement, params) {
|
||||
statement.each.apply(statement, params).finalize();
|
||||
return this;
|
||||
});
|
||||
|
||||
Database.prototype.map = normalizeMethod(function(statement, params) {
|
||||
statement.map.apply(statement, params).finalize();
|
||||
return this;
|
||||
});
|
||||
|
||||
Statement.prototype.map = function() {
|
||||
var params = Array.prototype.slice.call(arguments);
|
||||
var callback = params.pop();
|
||||
params.push(function(err, rows) {
|
||||
if (err) return callback(err);
|
||||
var result = {};
|
||||
if (rows.length) {
|
||||
var keys = Object.keys(rows[0]), key = keys[0];
|
||||
if (keys.length > 2) {
|
||||
// Value is an object
|
||||
for (var i = 0; i < rows.length; i++) {
|
||||
result[rows[i][key]] = rows[i];
|
||||
}
|
||||
} else {
|
||||
var value = keys[1];
|
||||
// Value is a plain value
|
||||
for (var i = 0; i < rows.length; i++) {
|
||||
result[rows[i][key]] = rows[i][value];
|
||||
}
|
||||
}
|
||||
}
|
||||
callback(err, result);
|
||||
});
|
||||
return this.all.apply(this, params);
|
||||
};
|
||||
|
||||
var isVerbose = false;
|
||||
|
||||
var supportedEvents = [ 'trace', 'profile', 'insert', 'update', 'delete' ];
|
||||
|
||||
Database.prototype.addListener = Database.prototype.on = function(type) {
|
||||
var val = EventEmitter.prototype.addListener.apply(this, arguments);
|
||||
if (supportedEvents.indexOf(type) >= 0) {
|
||||
this.configure(type, true);
|
||||
}
|
||||
return val;
|
||||
};
|
||||
|
||||
Database.prototype.removeListener = function(type) {
|
||||
var val = EventEmitter.prototype.removeListener.apply(this, arguments);
|
||||
if (supportedEvents.indexOf(type) >= 0 && !this._events[type]) {
|
||||
this.configure(type, false);
|
||||
}
|
||||
return val;
|
||||
};
|
||||
|
||||
Database.prototype.removeAllListeners = function(type) {
|
||||
var val = EventEmitter.prototype.removeAllListeners.apply(this, arguments);
|
||||
if (supportedEvents.indexOf(type) >= 0) {
|
||||
this.configure(type, false);
|
||||
}
|
||||
return val;
|
||||
};
|
||||
|
||||
// Save the stack trace over EIO callbacks.
|
||||
sqlite3.verbose = function() {
|
||||
if (!isVerbose) {
|
||||
var trace = require('./trace');
|
||||
[
|
||||
'prepare',
|
||||
'get',
|
||||
'run',
|
||||
'all',
|
||||
'each',
|
||||
'map',
|
||||
'close',
|
||||
'exec'
|
||||
].forEach(function (name) {
|
||||
trace.extendTrace(Database.prototype, name);
|
||||
});
|
||||
[
|
||||
'bind',
|
||||
'get',
|
||||
'run',
|
||||
'all',
|
||||
'each',
|
||||
'map',
|
||||
'reset',
|
||||
'finalize',
|
||||
].forEach(function (name) {
|
||||
trace.extendTrace(Statement.prototype, name);
|
||||
});
|
||||
isVerbose = true;
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
42
node_modules/sqlite3/lib/trace.js
generated
vendored
Normal file
42
node_modules/sqlite3/lib/trace.js
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
// Inspired by https://github.com/tlrobinson/long-stack-traces
|
||||
var EventEmitter = require('events').EventEmitter;
|
||||
var util = require('util');
|
||||
|
||||
function extendTrace(object, property, pos) {
|
||||
var old = object[property];
|
||||
object[property] = function() {
|
||||
var error = new Error();
|
||||
var name = object.constructor.name + '#' + property + '(' +
|
||||
Array.prototype.slice.call(arguments).map(function(el) {
|
||||
return util.inspect(el, false, 0);
|
||||
}).join(', ') + ')';
|
||||
|
||||
if (typeof pos === 'undefined') pos = -1;
|
||||
if (pos < 0) pos += arguments.length;
|
||||
var cb = arguments[pos];
|
||||
if (typeof arguments[pos] === 'function') {
|
||||
arguments[pos] = function replacement() {
|
||||
try {
|
||||
return cb.apply(this, arguments);
|
||||
} catch (err) {
|
||||
if (err && err.stack && !err.__augmented) {
|
||||
err.stack = filter(err).join('\n');
|
||||
err.stack += '\n--> in ' + name;
|
||||
err.stack += '\n' + filter(error).slice(1).join('\n');
|
||||
err.__augmented = true;
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
};
|
||||
}
|
||||
return old.apply(this, arguments);
|
||||
};
|
||||
}
|
||||
exports.extendTrace = extendTrace;
|
||||
|
||||
|
||||
function filter(error) {
|
||||
return error.stack.split('\n').filter(function(line) {
|
||||
return line.indexOf(__filename) < 0;
|
||||
});
|
||||
}
|
||||
15
node_modules/sqlite3/node_modules/.bin/node-pre-gyp
generated
vendored
Normal file
15
node_modules/sqlite3/node_modules/.bin/node-pre-gyp
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
basedir=`dirname "$0"`
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
"$basedir/node" "$basedir/../node-pre-gyp/bin/node-pre-gyp" "$@"
|
||||
ret=$?
|
||||
else
|
||||
node "$basedir/../node-pre-gyp/bin/node-pre-gyp" "$@"
|
||||
ret=$?
|
||||
fi
|
||||
exit $ret
|
||||
7
node_modules/sqlite3/node_modules/.bin/node-pre-gyp.cmd
generated
vendored
Normal file
7
node_modules/sqlite3/node_modules/.bin/node-pre-gyp.cmd
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
@IF EXIST "%~dp0\node.exe" (
|
||||
"%~dp0\node.exe" "%~dp0\..\node-pre-gyp\bin\node-pre-gyp" %*
|
||||
) ELSE (
|
||||
@SETLOCAL
|
||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
node "%~dp0\..\node-pre-gyp\bin\node-pre-gyp" %*
|
||||
)
|
||||
30
node_modules/sqlite3/node_modules/nan/.dntrc
generated
vendored
Normal file
30
node_modules/sqlite3/node_modules/nan/.dntrc
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
## DNT config file
|
||||
## see https://github.com/rvagg/dnt
|
||||
|
||||
NODE_VERSIONS="\
|
||||
master \
|
||||
v0.11.13 \
|
||||
v0.10.30 \
|
||||
v0.10.29 \
|
||||
v0.10.28 \
|
||||
v0.10.26 \
|
||||
v0.10.25 \
|
||||
v0.10.24 \
|
||||
v0.10.23 \
|
||||
v0.10.22 \
|
||||
v0.10.21 \
|
||||
v0.10.20 \
|
||||
v0.10.19 \
|
||||
v0.8.28 \
|
||||
v0.8.27 \
|
||||
v0.8.26 \
|
||||
v0.8.24 \
|
||||
"
|
||||
OUTPUT_PREFIX="nan-"
|
||||
TEST_CMD=" \
|
||||
cd /dnt/ && \
|
||||
npm install && \
|
||||
node_modules/.bin/node-gyp --nodedir /usr/src/node/ rebuild --directory test && \
|
||||
node_modules/.bin/tap --gc test/js/*-test.js \
|
||||
"
|
||||
|
||||
374
node_modules/sqlite3/node_modules/nan/CHANGELOG.md
generated
vendored
Normal file
374
node_modules/sqlite3/node_modules/nan/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,374 @@
|
||||
# NAN ChangeLog
|
||||
|
||||
**Version 2.0.9: current Node 4.0.0, Node 12: 0.12.7, Node 10: 0.10.40, iojs: 3.2.0**
|
||||
|
||||
### 2.0.9 Sep 8 2015
|
||||
|
||||
- Bugfix: EscapableHandleScope in Nan::NewBuffer for Node 0.8 and 0.10 b1654d7
|
||||
|
||||
### 2.0.8 Aug 28 2015
|
||||
|
||||
- Work around duplicate linking bug in clang 11902da
|
||||
|
||||
### 2.0.7 Aug 26 2015
|
||||
|
||||
- Build: Repackage
|
||||
|
||||
### 2.0.6 Aug 26 2015
|
||||
|
||||
- Bugfix: Properly handle null callback in FunctionTemplate factory 6e99cb1
|
||||
- Bugfix: Remove unused static std::map instances 525bddc
|
||||
- Bugfix: Make better use of maybe versions of APIs bfba85b
|
||||
- Bugfix: Fix shadowing issues with handle in ObjectWrap 0a9072d
|
||||
|
||||
### 2.0.5 Aug 10 2015
|
||||
|
||||
- Bugfix: Reimplement weak callback in ObjectWrap 98d38c1
|
||||
- Bugfix: Make sure callback classes are not assignable, copyable or movable 81f9b1d
|
||||
|
||||
### 2.0.4 Aug 6 2015
|
||||
|
||||
- Build: Repackage
|
||||
|
||||
### 2.0.3 Aug 6 2015
|
||||
|
||||
- Bugfix: Don't use clang++ / g++ syntax extension. 231450e
|
||||
|
||||
### 2.0.2 Aug 6 2015
|
||||
|
||||
- Build: Repackage
|
||||
|
||||
### 2.0.1 Aug 6 2015
|
||||
|
||||
- Bugfix: Add workaround for missing REPLACE_INVALID_UTF8 60d6687
|
||||
- Bugfix: Reimplement ObjectWrap from scratch to prevent memory leaks 6484601
|
||||
- Bugfix: Fix Persistent leak in FunctionCallbackInfo and PropertyCallbackInfo 641ef5f
|
||||
- Bugfix: Add missing overload for Nan::NewInstance that takes argc/argv 29450ed
|
||||
|
||||
### 2.0.0 Jul 31 2015
|
||||
|
||||
- Change: Renamed identifiers with leading underscores b5932b4
|
||||
- Change: Replaced NanObjectWrapHandle with class NanObjectWrap 464f1e1
|
||||
- Change: Replace NanScope and NanEscpableScope macros with classes 47751c4
|
||||
- Change: Rename NanNewBufferHandle to NanNewBuffer 6745f99
|
||||
- Change: Rename NanBufferUse to NanNewBuffer 3e8b0a5
|
||||
- Change: Rename NanNewBuffer to NanCopyBuffer d6af78d
|
||||
- Change: Remove Nan prefix from all names 72d1f67
|
||||
- Change: Update Buffer API for new upstream changes d5d3291
|
||||
- Change: Rename Scope and EscapableScope to HandleScope and EscapableHandleScope 21a7a6a
|
||||
- Change: Get rid of Handles e6c0daf
|
||||
- Feature: Support io.js 3 with V8 4.4
|
||||
- Feature: Introduce NanPersistent 7fed696
|
||||
- Feature: Introduce NanGlobal 4408da1
|
||||
- Feature: Added NanTryCatch 10f1ca4
|
||||
- Feature: Update for V8 v4.3 4b6404a
|
||||
- Feature: Introduce NanNewOneByteString c543d32
|
||||
- Feature: Introduce namespace Nan 67ed1b1
|
||||
- Removal: Remove NanLocker and NanUnlocker dd6e401
|
||||
- Removal: Remove string converters, except NanUtf8String, which now follows the node implementation b5d00a9
|
||||
- Removal: Remove NanReturn* macros d90a25c
|
||||
- Removal: Remove HasInstance e8f84fe
|
||||
|
||||
|
||||
### 1.9.0 Jul 31 2015
|
||||
|
||||
- Feature: Added `NanFatalException` 81d4a2c
|
||||
- Feature: Added more error types 4265f06
|
||||
- Feature: Added dereference and function call operators to NanCallback c4b2ed0
|
||||
- Feature: Added indexed GetFromPersistent and SaveToPersistent edd510c
|
||||
- Feature: Added more overloads of SaveToPersistent and GetFromPersistent 8b1cef6
|
||||
- Feature: Added NanErrnoException dd87d9e
|
||||
- Correctness: Prevent assign, copy, and move for classes that do not support it 1f55c59, 4b808cb, c96d9b2, fba4a29, 3357130
|
||||
- Deprecation: Deprecate `NanGetPointerSafe` and `NanSetPointerSafe` 81d4a2c
|
||||
- Deprecation: Deprecate `NanBooleanOptionValue` and `NanUInt32OptionValue` 0ad254b
|
||||
|
||||
### 1.8.4 Apr 26 2015
|
||||
|
||||
- Build: Repackage
|
||||
|
||||
### 1.8.3 Apr 26 2015
|
||||
|
||||
- Bugfix: Include missing header 1af8648
|
||||
|
||||
### 1.8.2 Apr 23 2015
|
||||
|
||||
- Build: Repackage
|
||||
|
||||
### 1.8.1 Apr 23 2015
|
||||
|
||||
- Bugfix: NanObjectWrapHandle should take a pointer 155f1d3
|
||||
|
||||
### 1.8.0 Apr 23 2015
|
||||
|
||||
- Feature: Allow primitives with NanReturnValue 2e4475e
|
||||
- Feature: Added comparison operators to NanCallback 55b075e
|
||||
- Feature: Backport thread local storage 15bb7fa
|
||||
- Removal: Remove support for signatures with arguments 8a2069d
|
||||
- Correcteness: Replaced NanObjectWrapHandle macro with function 0bc6d59
|
||||
|
||||
### 1.7.0 Feb 28 2015
|
||||
|
||||
- Feature: Made NanCallback::Call accept optional target 8d54da7
|
||||
- Feature: Support atom-shell 0.21 0b7f1bb
|
||||
|
||||
### 1.6.2 Feb 6 2015
|
||||
|
||||
- Bugfix: NanEncode: fix argument type for node::Encode on io.js 2be8639
|
||||
|
||||
### 1.6.1 Jan 23 2015
|
||||
|
||||
- Build: version bump
|
||||
|
||||
### 1.5.3 Jan 23 2015
|
||||
|
||||
- Build: repackage
|
||||
|
||||
### 1.6.0 Jan 23 2015
|
||||
|
||||
- Deprecated `NanNewContextHandle` in favor of `NanNew<Context>` 49259af
|
||||
- Support utility functions moved in newer v8 versions (Node 0.11.15, io.js 1.0) a0aa179
|
||||
- Added `NanEncode`, `NanDecodeBytes` and `NanDecodeWrite` 75e6fb9
|
||||
|
||||
### 1.5.2 Jan 23 2015
|
||||
|
||||
- Bugfix: Fix non-inline definition build error with clang++ 21d96a1, 60fadd4
|
||||
- Bugfix: Readded missing String constructors 18d828f
|
||||
- Bugfix: Add overload handling NanNew<FunctionTemplate>(..) 5ef813b
|
||||
- Bugfix: Fix uv_work_cb versioning 997e4ae
|
||||
- Bugfix: Add function factory and test 4eca89c
|
||||
- Bugfix: Add object template factory and test cdcb951
|
||||
- Correctness: Lifted an io.js related typedef c9490be
|
||||
- Correctness: Make explicit downcasts of String lengths 00074e6
|
||||
- Windows: Limit the scope of disabled warning C4530 83d7deb
|
||||
|
||||
### 1.5.1 Jan 15 2015
|
||||
|
||||
- Build: version bump
|
||||
|
||||
### 1.4.3 Jan 15 2015
|
||||
|
||||
- Build: version bump
|
||||
|
||||
### 1.4.2 Jan 15 2015
|
||||
|
||||
- Feature: Support io.js 0dbc5e8
|
||||
|
||||
### 1.5.0 Jan 14 2015
|
||||
|
||||
- Feature: Support io.js b003843
|
||||
- Correctness: Improved NanNew internals 9cd4f6a
|
||||
- Feature: Implement progress to NanAsyncWorker 8d6a160
|
||||
|
||||
### 1.4.1 Nov 8 2014
|
||||
|
||||
- Bugfix: Handle DEBUG definition correctly
|
||||
- Bugfix: Accept int as Boolean
|
||||
|
||||
### 1.4.0 Nov 1 2014
|
||||
|
||||
- Feature: Added NAN_GC_CALLBACK 6a5c245
|
||||
- Performance: Removed unnecessary local handle creation 18a7243, 41fe2f8
|
||||
- Correctness: Added constness to references in NanHasInstance 02c61cd
|
||||
- Warnings: Fixed spurious warnings from -Wundef and -Wshadow, 541b122, 99d8cb6
|
||||
- Windoze: Shut Visual Studio up when compiling 8d558c1
|
||||
- License: Switch to plain MIT from custom hacked MIT license 11de983
|
||||
- Build: Added test target to Makefile e232e46
|
||||
- Performance: Removed superfluous scope in NanAsyncWorker f4b7821
|
||||
- Sugar/Feature: Added NanReturnThis() and NanReturnHolder() shorthands 237a5ff, d697208
|
||||
- Feature: Added suitable overload of NanNew for v8::Integer::NewFromUnsigned b27b450
|
||||
|
||||
### 1.3.0 Aug 2 2014
|
||||
|
||||
- Added NanNew<v8::String, std::string>(std::string)
|
||||
- Added NanNew<v8::String, std::string&>(std::string&)
|
||||
- Added NanAsciiString helper class
|
||||
- Added NanUtf8String helper class
|
||||
- Added NanUcs2String helper class
|
||||
- Deprecated NanRawString()
|
||||
- Deprecated NanCString()
|
||||
- Added NanGetIsolateData(v8::Isolate *isolate)
|
||||
- Added NanMakeCallback(v8::Handle<v8::Object> target, v8::Handle<v8::Function> func, int argc, v8::Handle<v8::Value>* argv)
|
||||
- Added NanMakeCallback(v8::Handle<v8::Object> target, v8::Handle<v8::String> symbol, int argc, v8::Handle<v8::Value>* argv)
|
||||
- Added NanMakeCallback(v8::Handle<v8::Object> target, const char* method, int argc, v8::Handle<v8::Value>* argv)
|
||||
- Added NanSetTemplate(v8::Handle<v8::Template> templ, v8::Handle<v8::String> name , v8::Handle<v8::Data> value, v8::PropertyAttribute attributes)
|
||||
- Added NanSetPrototypeTemplate(v8::Local<v8::FunctionTemplate> templ, v8::Handle<v8::String> name, v8::Handle<v8::Data> value, v8::PropertyAttribute attributes)
|
||||
- Added NanSetInstanceTemplate(v8::Local<v8::FunctionTemplate> templ, const char *name, v8::Handle<v8::Data> value)
|
||||
- Added NanSetInstanceTemplate(v8::Local<v8::FunctionTemplate> templ, v8::Handle<v8::String> name, v8::Handle<v8::Data> value, v8::PropertyAttribute attributes)
|
||||
|
||||
### 1.2.0 Jun 5 2014
|
||||
|
||||
- Add NanSetPrototypeTemplate
|
||||
- Changed NAN_WEAK_CALLBACK internals, switched _NanWeakCallbackData to class,
|
||||
introduced _NanWeakCallbackDispatcher
|
||||
- Removed -Wno-unused-local-typedefs from test builds
|
||||
- Made test builds Windows compatible ('Sleep()')
|
||||
|
||||
### 1.1.2 May 28 2014
|
||||
|
||||
- Release to fix more stuff-ups in 1.1.1
|
||||
|
||||
### 1.1.1 May 28 2014
|
||||
|
||||
- Release to fix version mismatch in nan.h and lack of changelog entry for 1.1.0
|
||||
|
||||
### 1.1.0 May 25 2014
|
||||
|
||||
- Remove nan_isolate, use v8::Isolate::GetCurrent() internally instead
|
||||
- Additional explicit overloads for NanNew(): (char*,int), (uint8_t*[,int]),
|
||||
(uint16_t*[,int), double, int, unsigned int, bool, v8::String::ExternalStringResource*,
|
||||
v8::String::ExternalAsciiStringResource*
|
||||
- Deprecate NanSymbol()
|
||||
- Added SetErrorMessage() and ErrorMessage() to NanAsyncWorker
|
||||
|
||||
### 1.0.0 May 4 2014
|
||||
|
||||
- Heavy API changes for V8 3.25 / Node 0.11.13
|
||||
- Use cpplint.py
|
||||
- Removed NanInitPersistent
|
||||
- Removed NanPersistentToLocal
|
||||
- Removed NanFromV8String
|
||||
- Removed NanMakeWeak
|
||||
- Removed NanNewLocal
|
||||
- Removed NAN_WEAK_CALLBACK_OBJECT
|
||||
- Removed NAN_WEAK_CALLBACK_DATA
|
||||
- Introduce NanNew, replaces NanNewLocal, NanPersistentToLocal, adds many overloaded typed versions
|
||||
- Introduce NanUndefined, NanNull, NanTrue and NanFalse
|
||||
- Introduce NanEscapableScope and NanEscapeScope
|
||||
- Introduce NanMakeWeakPersistent (requires a special callback to work on both old and new node)
|
||||
- Introduce NanMakeCallback for node::MakeCallback
|
||||
- Introduce NanSetTemplate
|
||||
- Introduce NanGetCurrentContext
|
||||
- Introduce NanCompileScript and NanRunScript
|
||||
- Introduce NanAdjustExternalMemory
|
||||
- Introduce NanAddGCEpilogueCallback, NanAddGCPrologueCallback, NanRemoveGCEpilogueCallback, NanRemoveGCPrologueCallback
|
||||
- Introduce NanGetHeapStatistics
|
||||
- Rename NanAsyncWorker#SavePersistent() to SaveToPersistent()
|
||||
|
||||
### 0.8.0 Jan 9 2014
|
||||
|
||||
- NanDispose -> NanDisposePersistent, deprecate NanDispose
|
||||
- Extract _NAN_*_RETURN_TYPE, pull up NAN_*()
|
||||
|
||||
### 0.7.1 Jan 9 2014
|
||||
|
||||
- Fixes to work against debug builds of Node
|
||||
- Safer NanPersistentToLocal (avoid reinterpret_cast)
|
||||
- Speed up common NanRawString case by only extracting flattened string when necessary
|
||||
|
||||
### 0.7.0 Dec 17 2013
|
||||
|
||||
- New no-arg form of NanCallback() constructor.
|
||||
- NanCallback#Call takes Handle rather than Local
|
||||
- Removed deprecated NanCallback#Run method, use NanCallback#Call instead
|
||||
- Split off _NAN_*_ARGS_TYPE from _NAN_*_ARGS
|
||||
- Restore (unofficial) Node 0.6 compatibility at NanCallback#Call()
|
||||
- Introduce NanRawString() for char* (or appropriate void*) from v8::String
|
||||
(replacement for NanFromV8String)
|
||||
- Introduce NanCString() for null-terminated char* from v8::String
|
||||
|
||||
### 0.6.0 Nov 21 2013
|
||||
|
||||
- Introduce NanNewLocal<T>(v8::Handle<T> value) for use in place of
|
||||
v8::Local<T>::New(...) since v8 started requiring isolate in Node 0.11.9
|
||||
|
||||
### 0.5.2 Nov 16 2013
|
||||
|
||||
- Convert SavePersistent and GetFromPersistent in NanAsyncWorker from protected and public
|
||||
|
||||
### 0.5.1 Nov 12 2013
|
||||
|
||||
- Use node::MakeCallback() instead of direct v8::Function::Call()
|
||||
|
||||
### 0.5.0 Nov 11 2013
|
||||
|
||||
- Added @TooTallNate as collaborator
|
||||
- New, much simpler, "include_dirs" for binding.gyp
|
||||
- Added full range of NAN_INDEX_* macros to match NAN_PROPERTY_* macros
|
||||
|
||||
### 0.4.4 Nov 2 2013
|
||||
|
||||
- Isolate argument from v8::Persistent::MakeWeak removed for 0.11.8+
|
||||
|
||||
### 0.4.3 Nov 2 2013
|
||||
|
||||
- Include node_object_wrap.h, removed from node.h for Node 0.11.8.
|
||||
|
||||
### 0.4.2 Nov 2 2013
|
||||
|
||||
- Handle deprecation of v8::Persistent::Dispose(v8::Isolate* isolate)) for
|
||||
Node 0.11.8 release.
|
||||
|
||||
### 0.4.1 Sep 16 2013
|
||||
|
||||
- Added explicit `#include <uv.h>` as it was removed from node.h for v0.11.8
|
||||
|
||||
### 0.4.0 Sep 2 2013
|
||||
|
||||
- Added NAN_INLINE and NAN_DEPRECATED and made use of them
|
||||
- Added NanError, NanTypeError and NanRangeError
|
||||
- Cleaned up code
|
||||
|
||||
### 0.3.2 Aug 30 2013
|
||||
|
||||
- Fix missing scope declaration in GetFromPersistent() and SaveToPersistent
|
||||
in NanAsyncWorker
|
||||
|
||||
### 0.3.1 Aug 20 2013
|
||||
|
||||
- fix "not all control paths return a value" compile warning on some platforms
|
||||
|
||||
### 0.3.0 Aug 19 2013
|
||||
|
||||
- Made NAN work with NPM
|
||||
- Lots of fixes to NanFromV8String, pulling in features from new Node core
|
||||
- Changed node::encoding to Nan::Encoding in NanFromV8String to unify the API
|
||||
- Added optional error number argument for NanThrowError()
|
||||
- Added NanInitPersistent()
|
||||
- Added NanReturnNull() and NanReturnEmptyString()
|
||||
- Added NanLocker and NanUnlocker
|
||||
- Added missing scopes
|
||||
- Made sure to clear disposed Persistent handles
|
||||
- Changed NanAsyncWorker to allocate error messages on the heap
|
||||
- Changed NanThrowError(Local<Value>) to NanThrowError(Handle<Value>)
|
||||
- Fixed leak in NanAsyncWorker when errmsg is used
|
||||
|
||||
### 0.2.2 Aug 5 2013
|
||||
|
||||
- Fixed usage of undefined variable with node::BASE64 in NanFromV8String()
|
||||
|
||||
### 0.2.1 Aug 5 2013
|
||||
|
||||
- Fixed 0.8 breakage, node::BUFFER encoding type not available in 0.8 for
|
||||
NanFromV8String()
|
||||
|
||||
### 0.2.0 Aug 5 2013
|
||||
|
||||
- Added NAN_PROPERTY_GETTER, NAN_PROPERTY_SETTER, NAN_PROPERTY_ENUMERATOR,
|
||||
NAN_PROPERTY_DELETER, NAN_PROPERTY_QUERY
|
||||
- Extracted _NAN_METHOD_ARGS, _NAN_GETTER_ARGS, _NAN_SETTER_ARGS,
|
||||
_NAN_PROPERTY_GETTER_ARGS, _NAN_PROPERTY_SETTER_ARGS,
|
||||
_NAN_PROPERTY_ENUMERATOR_ARGS, _NAN_PROPERTY_DELETER_ARGS,
|
||||
_NAN_PROPERTY_QUERY_ARGS
|
||||
- Added NanGetInternalFieldPointer, NanSetInternalFieldPointer
|
||||
- Added NAN_WEAK_CALLBACK, NAN_WEAK_CALLBACK_OBJECT,
|
||||
NAN_WEAK_CALLBACK_DATA, NanMakeWeak
|
||||
- Renamed THROW_ERROR to _NAN_THROW_ERROR
|
||||
- Added NanNewBufferHandle(char*, size_t, node::smalloc::FreeCallback, void*)
|
||||
- Added NanBufferUse(char*, uint32_t)
|
||||
- Added NanNewContextHandle(v8::ExtensionConfiguration*,
|
||||
v8::Handle<v8::ObjectTemplate>, v8::Handle<v8::Value>)
|
||||
- Fixed broken NanCallback#GetFunction()
|
||||
- Added optional encoding and size arguments to NanFromV8String()
|
||||
- Added NanGetPointerSafe() and NanSetPointerSafe()
|
||||
- Added initial test suite (to be expanded)
|
||||
- Allow NanUInt32OptionValue to convert any Number object
|
||||
|
||||
### 0.1.0 Jul 21 2013
|
||||
|
||||
- Added `NAN_GETTER`, `NAN_SETTER`
|
||||
- Added `NanThrowError` with single Local<Value> argument
|
||||
- Added `NanNewBufferHandle` with single uint32_t argument
|
||||
- Added `NanHasInstance(Persistent<FunctionTemplate>&, Handle<Value>)`
|
||||
- Added `Local<Function> NanCallback#GetFunction()`
|
||||
- Added `NanCallback#Call(int, Local<Value>[])`
|
||||
- Deprecated `NanCallback#Run(int, Local<Value>[])` in favour of Call
|
||||
13
node_modules/sqlite3/node_modules/nan/LICENSE.md
generated
vendored
Normal file
13
node_modules/sqlite3/node_modules/nan/LICENSE.md
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
The MIT License (MIT)
|
||||
=====================
|
||||
|
||||
Copyright (c) 2015 NAN contributors
|
||||
-----------------------------------
|
||||
|
||||
*NAN contributors listed at <https://github.com/nodejs/nan#contributors>*
|
||||
|
||||
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.
|
||||
367
node_modules/sqlite3/node_modules/nan/README.md
generated
vendored
Normal file
367
node_modules/sqlite3/node_modules/nan/README.md
generated
vendored
Normal file
@@ -0,0 +1,367 @@
|
||||
Native Abstractions for Node.js
|
||||
===============================
|
||||
|
||||
**A header file filled with macro and utility goodness for making add-on development for Node.js easier across versions 0.8, 0.10 and 0.12 as well as io.js.**
|
||||
|
||||
***Current version: 2.0.9***
|
||||
|
||||
*(See [CHANGELOG.md](https://github.com/nodejs/nan/blob/master/CHANGELOG.md) for complete ChangeLog)*
|
||||
|
||||
[](https://nodei.co/npm/nan/) [](https://nodei.co/npm/nan/)
|
||||
|
||||
[](http://travis-ci.org/nodejs/nan)
|
||||
[](https://ci.appveyor.com/project/RodVagg/nan)
|
||||
|
||||
Thanks to the crazy changes in V8 (and some in Node core), keeping native addons compiling happily across versions, particularly 0.10 to 0.12, is a minor nightmare. The goal of this project is to store all logic necessary to develop native Node.js addons without having to inspect `NODE_MODULE_VERSION` and get yourself into a macro-tangle.
|
||||
|
||||
This project also contains some helper utilities that make addon development a bit more pleasant.
|
||||
|
||||
* **[News & Updates](#news)**
|
||||
* **[Usage](#usage)**
|
||||
* **[Example](#example)**
|
||||
* **[API](#api)**
|
||||
* **[Tests](#tests)**
|
||||
* **[Governance & Contributing](#governance)**
|
||||
|
||||
<a name="news"></a>
|
||||
## News & Updates
|
||||
|
||||
<a name="usage"></a>
|
||||
## Usage
|
||||
|
||||
Simply add **NAN** as a dependency in the *package.json* of your Node addon:
|
||||
|
||||
``` bash
|
||||
$ npm install --save nan
|
||||
```
|
||||
|
||||
Pull in the path to **NAN** in your *binding.gyp* so that you can use `#include <nan.h>` in your *.cpp* files:
|
||||
|
||||
``` python
|
||||
"include_dirs" : [
|
||||
"<!(node -e \"require('nan')\")"
|
||||
]
|
||||
```
|
||||
|
||||
This works like a `-I<path-to-NAN>` when compiling your addon.
|
||||
|
||||
<a name="example"></a>
|
||||
## Example
|
||||
|
||||
Just getting started with Nan? Refer to a [quick-start **Nan** Boilerplate](https://github.com/fcanas/node-native-boilerplate) for a ready-to-go project that utilizes basic Nan functionality.
|
||||
|
||||
For a simpler example, see the **[async pi estimation example](https://github.com/nodejs/nan/tree/master/examples/async_pi_estimate)** in the examples directory for full code and an explanation of what this Monte Carlo Pi estimation example does. Below are just some parts of the full example that illustrate the use of **NAN**.
|
||||
|
||||
For another example, see **[nan-example-eol](https://github.com/CodeCharmLtd/nan-example-eol)**. It shows newline detection implemented as a native addon.
|
||||
|
||||
<a name="api"></a>
|
||||
## API
|
||||
|
||||
Additional to the NAN documentation below, please consult:
|
||||
|
||||
* [The V8 Getting Started Guide](https://developers.google.com/v8/get_started)
|
||||
* [The V8 Embedders Guide](https://developers.google.com/v8/embed)
|
||||
* [V8 API Documentation](http://v8docs.nodesource.com/)
|
||||
|
||||
<!-- START API -->
|
||||
|
||||
### JavaScript-accessible methods
|
||||
|
||||
A _template_ is a blueprint for JavaScript functions and objects in a context. You can use a template to wrap C++ functions and data structures within JavaScript objects so that they can be manipulated from JavaScript. See the V8 Embedders Guide section on [Templates](https://developers.google.com/v8/embed#templates) for further information.
|
||||
|
||||
In order to expose functionality to JavaScript via a template, you must provide it to V8 in a form that it understands. Across the versions of V8 supported by NAN, JavaScript-accessible method signatures vary widely, NAN fully abstracts method declaration and provides you with an interface that is similar to the most recent V8 API but is backward-compatible with older versions that still use the now-deceased `v8::Argument` type.
|
||||
|
||||
* **Method argument types**
|
||||
- <a href="doc/methods.md#api_nan_function_callback_info"><b><code>Nan::FunctionCallbackInfo</code></b></a>
|
||||
- <a href="doc/methods.md#api_nan_property_callback_info"><b><code>Nan::PropertyCallbackInfo</code></b></a>
|
||||
- <a href="doc/methods.md#api_nan_return_value"><b><code>Nan::ReturnValue</code></b></a>
|
||||
* **Method declarations**
|
||||
- <a href="doc/methods.md#api_nan_method"><b>Method declaration</b></a>
|
||||
- <a href="doc/methods.md#api_nan_getter"><b>Getter declaration</b></a>
|
||||
- <a href="doc/methods.md#api_nan_setter"><b>Setter declaration</b></a>
|
||||
- <a href="doc/methods.md#api_nan_property_getter"><b>Property getter declaration</b></a>
|
||||
- <a href="doc/methods.md#api_nan_property_setter"><b>Property setter declaration</b></a>
|
||||
- <a href="doc/methods.md#api_nan_property_enumerator"><b>Property enumerator declaration</b></a>
|
||||
- <a href="doc/methods.md#api_nan_property_deleter"><b>Property deleter declaration</b></a>
|
||||
- <a href="doc/methods.md#api_nan_property_query"><b>Property query declaration</b></a>
|
||||
- <a href="doc/methods.md#api_nan_index_getter"><b>Index getter declaration</b></a>
|
||||
- <a href="doc/methods.md#api_nan_index_setter"><b>Index setter declaration</b></a>
|
||||
- <a href="doc/methods.md#api_nan_index_enumerator"><b>Index enumerator declaration</b></a>
|
||||
- <a href="doc/methods.md#api_nan_index_deleter"><b>Index deleter declaration</b></a>
|
||||
- <a href="doc/methods.md#api_nan_index_query"><b>Index query declaration</b></a>
|
||||
* Method and template helpers
|
||||
- <a href="doc/methods.md#api_nan_set_method"><b><code>Nan::SetMethod()</code></b></a>
|
||||
- <a href="doc/methods.md#api_nan_set_named_property_handler"><b><code>Nan::SetNamedPropertyHandler()</code></b></a>
|
||||
- <a href="doc/methods.md#api_nan_set_indexed_property_handler"><b><code>Nan::SetIndexedPropertyHandler()</code></b></a>
|
||||
- <a href="doc/methods.md#api_nan_set_prototype_method"><b><code>Nan::SetPrototypeMethod()</code></b></a>
|
||||
- <a href="doc/methods.md#api_nan_set_template"><b><code>Nan::SetTemplate()</code></b></a>
|
||||
- <a href="doc/methods.md#api_nan_set_prototype_template"><b><code>Nan::SetPrototypeTemplate()</code></b></a>
|
||||
- <a href="doc/methods.md#api_nan_set_instance_template"><b><code>Nan::SetInstanceTemplate()</code></b></a>
|
||||
|
||||
### Scopes
|
||||
|
||||
A _local handle_ is a pointer to an object. All V8 objects are accessed using handles, they are necessary because of the way the V8 garbage collector works.
|
||||
|
||||
A handle scope can be thought of as a container for any number of handles. When you've finished with your handles, instead of deleting each one individually you can simply delete their scope.
|
||||
|
||||
The creation of `HandleScope` objects is different across the supported versions of V8. Therefore, NAN provides its own implementations that can be used safely across these.
|
||||
|
||||
- <a href="doc/scopes.md#api_nan_handle_scope"><b><code>Nan::HandleScope</code></b></a>
|
||||
- <a href="doc/scopes.md#api_nan_escapable_handle_scope"><b><code>Nan::EscapableHandleScope</code></b></a>
|
||||
|
||||
Also see the V8 Embedders Guide section on [Handles and Garbage Collection](https://developers.google.com/v8/embed#handles).
|
||||
|
||||
### Persistent references
|
||||
|
||||
An object reference that is independent of any `HandleScope` is a _persistent_ reference. Where a `Local` handle only lives as long as the `HandleScope` in which it was allocated, a `Persistent` handle remains valid until it is explicitly disposed.
|
||||
|
||||
Due to the evolution of the V8 API, it is necessary for NAN to provide a wrapper implementation of the `Persistent` classes to supply compatibility across the V8 versions supported.
|
||||
|
||||
- <a href="doc/persistent.md#api_nan_persistent_base"><b><code>Nan::PersistentBase & v8::PersistentBase</code></b></a>
|
||||
- <a href="doc/persistent.md#api_nan_non_copyable_persistent_traits"><b><code>Nan::NonCopyablePersistentTraits & v8::NonCopyablePersistentTraits</code></b></a>
|
||||
- <a href="doc/persistent.md#api_nan_copyable_persistent_traits"><b><code>Nan::CopyablePersistentTraits & v8::CopyablePersistentTraits</code></b></a>
|
||||
- <a href="doc/persistent.md#api_nan_persistent"><b><code>Nan::Persistent</code></b></a>
|
||||
- <a href="doc/persistent.md#api_nan_global"><b><code>Nan::Global</code></b></a>
|
||||
- <a href="doc/persistent.md#api_nan_weak_callback_info"><b><code>Nan::WeakCallbackInfo</code></b></a>
|
||||
- <a href="doc/persistent.md#api_nan_weak_callback_type"><b><code>Nan::WeakCallbackType</code></b></a>
|
||||
|
||||
Also see the V8 Embedders Guide section on [Handles and Garbage Collection](https://developers.google.com/v8/embed#handles).
|
||||
|
||||
### New
|
||||
|
||||
NAN provides a `Nan::New()` helper for the creation of new JavaScript objects in a way that's compatible across the supported versions of V8.
|
||||
|
||||
- <a href="doc/new.md#api_nan_new"><b><code>Nan::New()</code></b></a>
|
||||
- <a href="doc/new.md#api_nan_undefined"><b><code>Nan::Undefined()</code></b></a>
|
||||
- <a href="doc/new.md#api_nan_null"><b><code>Nan::Null()</code></b></a>
|
||||
- <a href="doc/new.md#api_nan_true"><b><code>Nan::True()</code></b></a>
|
||||
- <a href="doc/new.md#api_nan_false"><b><code>Nan::False()</code></b></a>
|
||||
- <a href="doc/new.md#api_nan_empty_string"><b><code>Nan::EmptyString()</code></b></a>
|
||||
|
||||
|
||||
### Converters
|
||||
|
||||
NAN contains functions that convert `v8::Value`s to other `v8::Value` types and native types. Since type conversion is not guaranteed to succeed, they return `Nan::Maybe` types. These converters can be used in place of `value->ToX()` and `value->XValue()` (where `X` is one of the types, e.g. `Boolean`) in a way that provides a consistent interface across V8 versions. Newer versions of V8 use the new `v8::Maybe` and `v8::MaybeLocal` types for these conversions, older versions don't have this functionality so it is provided by NAN.
|
||||
|
||||
- <a href="doc/converters.md#api_nan_to"><b><code>Nan::To()</code></b></a>
|
||||
|
||||
### Maybe Types
|
||||
|
||||
The `Nan::MaybeLocal` and `Nan::Maybe` types are monads that encapsulate `v8::Local` handles that _may be empty_.
|
||||
|
||||
* **Maybe Types**
|
||||
- <a href="doc/maybe_types.md#api_nan_maybe_local"><b><code>Nan::MaybeLocal</code></b></a>
|
||||
- <a href="doc/maybe_types.md#api_nan_maybe"><b><code>Nan::Maybe</code></b></a>
|
||||
- <a href="doc/maybe_types.md#api_nan_nothing"><b><code>Nan::Nothing</code></b></a>
|
||||
- <a href="doc/maybe_types.md#api_nan_just"><b><code>Nan::Just</code></b></a>
|
||||
* **Maybe Helpers**
|
||||
- <a href="doc/maybe_types.md#api_nan_to_detail_string"><b><code>Nan::ToDetailString()</code></b></a>
|
||||
- <a href="doc/maybe_types.md#api_nan_to_array_index"><b><code>Nan::ToArrayIndex()</code></b></a>
|
||||
- <a href="doc/maybe_types.md#api_nan_equals"><b><code>Nan::Equals()</code></b></a>
|
||||
- <a href="doc/maybe_types.md#api_nan_new_instance"><b><code>Nan::NewInstance()</code></b></a>
|
||||
- <a href="doc/maybe_types.md#api_nan_get_function"><b><code>Nan::GetFunction()</code></b></a>
|
||||
- <a href="doc/maybe_types.md#api_nan_set"><b><code>Nan::Set()</code></b></a>
|
||||
- <a href="doc/maybe_types.md#api_nan_force_set"><b><code>Nan::ForceSet()</code></b></a>
|
||||
- <a href="doc/maybe_types.md#api_nan_get"><b><code>Nan::Get()</code></b></a>
|
||||
- <a href="doc/maybe_types.md#api_nan_get_property_attribute"><b><code>Nan::GetPropertyAttributes()</code></b></a>
|
||||
- <a href="doc/maybe_types.md#api_nan_has"><b><code>Nan::Has()</code></b></a>
|
||||
- <a href="doc/maybe_types.md#api_nan_delete"><b><code>Nan::Delete()</code></b></a>
|
||||
- <a href="doc/maybe_types.md#api_nan_get_property_names"><b><code>Nan::GetPropertyNames()</code></b></a>
|
||||
- <a href="doc/maybe_types.md#api_nan_get_own_property_names"><b><code>Nan::GetOwnPropertyNames()</code></b></a>
|
||||
- <a href="doc/maybe_types.md#api_nan_set_prototype"><b><code>Nan::SetPrototype()</code></b></a>
|
||||
- <a href="doc/maybe_types.md#api_nan_object_proto_to_string"><b><code>Nan::ObjectProtoToString()</code></b></a>
|
||||
- <a href="doc/maybe_types.md#api_nan_has_own_property"><b><code>Nan::HasOwnProperty()</code></b></a>
|
||||
- <a href="doc/maybe_types.md#api_nan_has_real_named_property"><b><code>Nan::HasRealNamedProperty()</code></b></a>
|
||||
- <a href="doc/maybe_types.md#api_nan_has_real_indexed_property"><b><code>Nan::HasRealIndexedProperty()</code></b></a>
|
||||
- <a href="doc/maybe_types.md#api_nan_has_real_named_callback_property"><b><code>Nan::HasRealNamedCallbackProperty()</code></b></a>
|
||||
- <a href="doc/maybe_types.md#api_nan_get_real_named_property_in_prototype_chain"><b><code>Nan::GetRealNamedPropertyInPrototypeChain()</code></b></a>
|
||||
- <a href="doc/maybe_types.md#api_nan_get_real_named_property"><b><code>Nan::GetRealNamedProperty()</code></b></a>
|
||||
- <a href="doc/maybe_types.md#api_nan_call_as_function"><b><code>Nan::CallAsFunction()</code></b></a>
|
||||
- <a href="doc/maybe_types.md#api_nan_call_as_constructor"><b><code>Nan::CallAsConstructor()</code></b></a>
|
||||
- <a href="doc/maybe_types.md#api_nan_get_source_line"><b><code>Nan::GetSourceLine()</code></b></a>
|
||||
- <a href="doc/maybe_types.md#api_nan_get_line_number"><b><code>Nan::GetLineNumber()</code></b></a>
|
||||
- <a href="doc/maybe_types.md#api_nan_get_start_column"><b><code>Nan::GetStartColumn()</code></b></a>
|
||||
- <a href="doc/maybe_types.md#api_nan_get_end_column"><b><code>Nan::GetEndColumn()</code></b></a>
|
||||
- <a href="doc/maybe_types.md#api_nan_clone_element_at"><b><code>Nan::CloneElementAt()</code></b></a>
|
||||
|
||||
### Script
|
||||
|
||||
NAN provides a `v8::Script` helpers as the API has changed over the supported versions of V8.
|
||||
|
||||
- <a href="doc/script.md#api_nan_compile_script"><b><code>Nan::CompileScript()</code></b></a>
|
||||
- <a href="doc/script.md#api_nan_run_script"><b><code>Nan::RunScript()</code></b></a>
|
||||
|
||||
|
||||
### Errors
|
||||
|
||||
NAN includes helpers for creating, throwing and catching Errors as much of this functionality varies across the supported versions of V8 and must be abstracted.
|
||||
|
||||
Note that an Error object is simply a specialized form of `v8::Value`.
|
||||
|
||||
Also consult the V8 Embedders Guide section on [Exceptions](https://developers.google.com/v8/embed#exceptions) for more information.
|
||||
|
||||
- <a href="doc/errors.md#api_nan_error"><b><code>Nan::Error()</code></b></a>
|
||||
- <a href="doc/errors.md#api_nan_range_error"><b><code>Nan::RangeError()</code></b></a>
|
||||
- <a href="doc/errors.md#api_nan_reference_error"><b><code>Nan::ReferenceError()</code></b></a>
|
||||
- <a href="doc/errors.md#api_nan_syntax_error"><b><code>Nan::SyntaxError()</code></b></a>
|
||||
- <a href="doc/errors.md#api_nan_type_error"><b><code>Nan::TypeError()</code></b></a>
|
||||
- <a href="doc/errors.md#api_nan_throw_error"><b><code>Nan::ThrowError()</code></b></a>
|
||||
- <a href="doc/errors.md#api_nan_throw_range_error"><b><code>Nan::ThrowRangeError()</code></b></a>
|
||||
- <a href="doc/errors.md#api_nan_throw_reference_error"><b><code>Nan::ThrowReferenceError()</code></b></a>
|
||||
- <a href="doc/errors.md#api_nan_throw_syntax_error"><b><code>Nan::ThrowSyntaxError()</code></b></a>
|
||||
- <a href="doc/errors.md#api_nan_throw_type_error"><b><code>Nan::ThrowTypeError()</code></b></a>
|
||||
- <a href="doc/errors.md#api_nan_fatal_exception"><b><code>Nan::FatalException()</code></b></a>
|
||||
- <a href="doc/errors.md#api_nan_errno_exception"><b><code>Nan::ErrnoException()</code></b></a>
|
||||
- <a href="doc/errors.md#api_nan_try_catch"><b><code>Nan::TryCatch</code></b></a>
|
||||
|
||||
|
||||
### Buffers
|
||||
|
||||
NAN's `node::Buffer` helpers exist as the API has changed across supported Node versions. Use these methods to ensure compatibility.
|
||||
|
||||
- <a href="doc/buffers.md#api_nan_new_buffer"><b><code>Nan::NewBuffer()</code></b></a>
|
||||
- <a href="doc/buffers.md#api_nan_copy_buffer"><b><code>Nan::CopyBuffer()</code></b></a>
|
||||
- <a href="doc/buffers.md#api_nan_free_callback"><b><code>Nan::FreeCallback()</code></b></a>
|
||||
|
||||
### Nan::Callback
|
||||
|
||||
`Nan::Callback` makes it easier to use `v8::Function` handles as callbacks. A class that wraps a `v8::Function` handle, protecting it from garbage collection and making it particularly useful for storage and use across asynchronous execution.
|
||||
|
||||
- <a href="doc/callback.md#api_nan_callback"><b><code>Nan::Callback</code></b></a>
|
||||
|
||||
### Asynchronous work helpers
|
||||
|
||||
`Nan::AsyncWorker` and `Nan::AsyncProgressWorker` are helper classes that make working with asynchronous code easier.
|
||||
|
||||
- <a href="doc/asyncworker.md#api_nan_async_worker"><b><code>Nan::AsyncWorker</code></b></a>
|
||||
- <a href="doc/asyncworker.md#api_nan_async_progress_worker"><b><code>Nan::AsyncProgressWorker</code></b></a>
|
||||
- <a href="doc/asyncworker.md#api_nan_async_queue_worker"><b><code>Nan::AsyncQueueWorker</code></b></a>
|
||||
|
||||
### Strings & Bytes
|
||||
|
||||
Miscellaneous string & byte encoding and decoding functionality provided for compatibility across supported versions of V8 and Node. Implemented by NAN to ensure that all encoding types are supported, even for older versions of Node where they are missing.
|
||||
|
||||
- <a href="doc/string_bytes.md#api_nan_encoding"><b><code>Nan::Encoding</code></b></a>
|
||||
- <a href="doc/string_bytes.md#api_nan_encode"><b><code>Nan::Encode()</code></b></a>
|
||||
- <a href="doc/string_bytes.md#api_nan_decode_bytes"><b><code>Nan::DecodeBytes()</code></b></a>
|
||||
- <a href="doc/string_bytes.md#api_nan_decode_write"><b><code>Nan::DecodeWrite()</code></b></a>
|
||||
|
||||
|
||||
### V8 internals
|
||||
|
||||
The hooks to access V8 internals—including GC and statistics—are different across the supported versions of V8, therefore NAN provides its own hooks that call the appropriate V8 methods.
|
||||
|
||||
- <a href="doc/v8_internals.md#api_nan_gc_callback"><b><code>NAN_GC_CALLBACK()</code></b></a>
|
||||
- <a href="doc/v8_internals.md#api_nan_add_gc_epilogue_callback"><b><code>Nan::AddGCEpilogueCallback()</code></b></a>
|
||||
- <a href="doc/v8_internals.md#api_nan_remove_gc_epilogue_callback"><b><code>Nan::RemoveGCEpilogueCallback()</code></b></a>
|
||||
- <a href="doc/v8_internals.md#api_nan_add_gc_prologue_callback"><b><code>Nan::AddGCPrologueCallback()</code></b></a>
|
||||
- <a href="doc/v8_internals.md#api_nan_remove_gc_prologue_callback"><b><code>Nan::RemoveGCPrologueCallback()</code></b></a>
|
||||
- <a href="doc/v8_internals.md#api_nan_get_heap_statistics"><b><code>Nan::GetHeapStatistics()</code></b></a>
|
||||
- <a href="doc/v8_internals.md#api_nan_set_counter_function"><b><code>Nan::SetCounterFunction()</code></b></a>
|
||||
- <a href="doc/v8_internals.md#api_nan_set_create_histogram_function"><b><code>Nan::SetCreateHistogramFunction()</code></b></a>
|
||||
- <a href="doc/v8_internals.md#api_nan_set_add_histogram_sample_function"><b><code>Nan::SetAddHistogramSampleFunction()</code></b></a>
|
||||
- <a href="doc/v8_internals.md#api_nan_idle_notification"><b><code>Nan::IdleNotification()</code></b></a>
|
||||
- <a href="doc/v8_internals.md#api_nan_low_memory_notification"><b><code>Nan::LowMemoryNotification()</code></b></a>
|
||||
- <a href="doc/v8_internals.md#api_nan_context_disposed_notification"><b><code>Nan::ContextDisposedNotification()</code></b></a>
|
||||
- <a href="doc/v8_internals.md#api_nan_get_internal_field_pointer"><b><code>Nan::GetInternalFieldPointer()</code></b></a>
|
||||
- <a href="doc/v8_internals.md#api_nan_set_internal_field_pointer"><b><code>Nan::SetInternalFieldPointer()</code></b></a>
|
||||
- <a href="doc/v8_internals.md#api_nan_adjust_external_memory"><b><code>Nan::AdjustExternalMemory()</code></b></a>
|
||||
|
||||
|
||||
### Miscellaneous V8 Helpers
|
||||
|
||||
- <a href="doc/v8_misc.md#api_nan_utf8_string"><b><code>Nan::Utf8String</code></b></a>
|
||||
- <a href="doc/v8_misc.md#api_nan_get_current_context"><b><code>Nan::GetCurrentContext()</code></b></a>
|
||||
- <a href="doc/v8_misc.md#api_nan_set_isolate_data"><b><code>Nan::SetIsolateData()</code></b></a>
|
||||
- <a href="doc/v8_misc.md#api_nan_get_isolate_data"><b><code>Nan::GetIsolateData()</code></b></a>
|
||||
|
||||
|
||||
### Miscellaneous Node Helpers
|
||||
|
||||
- <a href="doc/node_misc.md#api_nan_make_callback"><b><code>Nan::MakeCallback()</code></b></a>
|
||||
- <a href="doc/node_misc.md#api_nan_object_wrap"><b><code>Nan::ObjectWrap</code></b></a>
|
||||
- <a href="doc/node_misc.md#api_nan_module_init"><b><code>NAN_MODULE_INIT()</code></b></a>
|
||||
- <a href="doc/node_misc.md#api_nan_export"><b><code>Nan::Export()</code></b></a>
|
||||
|
||||
<!-- END API -->
|
||||
|
||||
|
||||
<a name="tests"></a>
|
||||
### Tests
|
||||
|
||||
To run the NAN tests do:
|
||||
|
||||
``` sh
|
||||
npm install
|
||||
npm run-script rebuild-tests
|
||||
npm test
|
||||
```
|
||||
|
||||
Or just:
|
||||
|
||||
``` sh
|
||||
npm install
|
||||
make test
|
||||
```
|
||||
|
||||
<a name="governance"></a>
|
||||
## Governance & Contributing
|
||||
|
||||
NAN is governed by the [io.js](https://iojs.org/) Addon API Working Group
|
||||
|
||||
### Addon API Working Group (WG)
|
||||
|
||||
The NAN project is jointly governed by a Working Group which is responsible for high-level guidance of the project.
|
||||
|
||||
Members of the WG are also known as Collaborators, there is no distinction between the two, unlike other io.js projects.
|
||||
|
||||
The WG has final authority over this project including:
|
||||
|
||||
* Technical direction
|
||||
* Project governance and process (including this policy)
|
||||
* Contribution policy
|
||||
* GitHub repository hosting
|
||||
* Maintaining the list of additional Collaborators
|
||||
|
||||
For the current list of WG members, see the project [README.md](./README.md#collaborators).
|
||||
|
||||
Individuals making significant and valuable contributions are made members of the WG and given commit-access to the project. These individuals are identified by the WG and their addition to the WG is discussed via GitHub and requires unanimous consensus amongst those WG members participating in the discussion with a quorum of 50% of WG members required for acceptance of the vote.
|
||||
|
||||
_Note:_ If you make a significant contribution and are not considered for commit-access log an issue or contact a WG member directly.
|
||||
|
||||
For the current list of WG members / Collaborators, see the project [README.md](./README.md#collaborators).
|
||||
|
||||
### Consensus Seeking Process
|
||||
|
||||
The WG follows a [Consensus Seeking](http://en.wikipedia.org/wiki/Consensus-seeking_decision-making) decision making model.
|
||||
|
||||
Modifications of the contents of the NAN repository are made on a collaborative basis. Anybody with a GitHub account may propose a modification via pull request and it will be considered by the WG. All pull requests must be reviewed and accepted by a WG member with sufficient expertise who is able to take full responsibility for the change. In the case of pull requests proposed by an existing WG member, an additional WG member is required for sign-off. Consensus should be sought if additional WG members participate and there is disagreement around a particular modification.
|
||||
|
||||
If a change proposal cannot reach a consensus, a WG member can call for a vote amongst the members of the WG. Simple majority wins.
|
||||
|
||||
### Developer's Certificate of Origin 1.0
|
||||
|
||||
By making a contribution to this project, I certify that:
|
||||
|
||||
* (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or
|
||||
* (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or
|
||||
* (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.
|
||||
|
||||
<a name="collaborators"></a>
|
||||
### WG Members / Collaborators
|
||||
|
||||
<table><tbody>
|
||||
<tr><th align="left">Rod Vagg</th><td><a href="https://github.com/rvagg">GitHub/rvagg</a></td><td><a href="http://twitter.com/rvagg">Twitter/@rvagg</a></td></tr>
|
||||
<tr><th align="left">Benjamin Byholm</th><td><a href="https://github.com/kkoopa/">GitHub/kkoopa</a></td><td>-</td></tr>
|
||||
<tr><th align="left">Trevor Norris</th><td><a href="https://github.com/trevnorris">GitHub/trevnorris</a></td><td><a href="http://twitter.com/trevnorris">Twitter/@trevnorris</a></td></tr>
|
||||
<tr><th align="left">Nathan Rajlich</th><td><a href="https://github.com/TooTallNate">GitHub/TooTallNate</a></td><td><a href="http://twitter.com/TooTallNate">Twitter/@TooTallNate</a></td></tr>
|
||||
<tr><th align="left">Brett Lawson</th><td><a href="https://github.com/brett19">GitHub/brett19</a></td><td><a href="http://twitter.com/brett19x">Twitter/@brett19x</a></td></tr>
|
||||
<tr><th align="left">Ben Noordhuis</th><td><a href="https://github.com/bnoordhuis">GitHub/bnoordhuis</a></td><td><a href="http://twitter.com/bnoordhuis">Twitter/@bnoordhuis</a></td></tr>
|
||||
<tr><th align="left">David Siegel</th><td><a href="https://github.com/agnat">GitHub/agnat</a></td><td>-</td></tr>
|
||||
</tbody></table>
|
||||
|
||||
## Licence & copyright
|
||||
|
||||
Copyright (c) 2015 NAN WG Members / Collaborators (listed above).
|
||||
|
||||
Native Abstractions for Node.js is licensed under an MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.
|
||||
38
node_modules/sqlite3/node_modules/nan/appveyor.yml
generated
vendored
Normal file
38
node_modules/sqlite3/node_modules/nan/appveyor.yml
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
# http://www.appveyor.com/docs/appveyor-yml
|
||||
|
||||
# Test against these versions of Io.js and Node.js.
|
||||
environment:
|
||||
matrix:
|
||||
# node.js
|
||||
- nodejs_version: "0.8"
|
||||
- nodejs_version: "0.10"
|
||||
- nodejs_version: "0.12"
|
||||
# io.js
|
||||
- nodejs_version: "1"
|
||||
- nodejs_version: "2"
|
||||
- nodejs_version: "3"
|
||||
|
||||
# Install scripts. (runs after repo cloning)
|
||||
install:
|
||||
# Get the latest stable version of Node 0.STABLE.latest
|
||||
- ps: if($env:nodejs_version -eq "0.8") {Install-Product node $env:nodejs_version}
|
||||
- ps: if($env:nodejs_version -ne "0.8") {Update-NodeJsInstallation (Get-NodeJsLatestBuild $env:nodejs_version)}
|
||||
- IF %nodejs_version% LSS 1 npm -g install npm
|
||||
- IF %nodejs_version% LSS 1 set PATH=%APPDATA%\npm;%PATH%
|
||||
# Typical npm stuff.
|
||||
- npm install
|
||||
- IF %nodejs_version% EQU 0.8 (node node_modules\node-gyp\bin\node-gyp.js rebuild --msvs_version=2013 --directory test) ELSE (npm run rebuild-tests)
|
||||
|
||||
# Post-install test scripts.
|
||||
test_script:
|
||||
# Output useful info for debugging.
|
||||
- node --version
|
||||
- npm --version
|
||||
# run tests
|
||||
- IF %nodejs_version% LSS 1 (npm test) ELSE (iojs node_modules\tap\bin\tap.js --gc test/js/*-test.js)
|
||||
|
||||
# Don't actually build.
|
||||
build: off
|
||||
|
||||
# Set build version format here instead of in the admin panel.
|
||||
version: "{build}"
|
||||
38
node_modules/sqlite3/node_modules/nan/doc/.build.sh
generated
vendored
Normal file
38
node_modules/sqlite3/node_modules/nan/doc/.build.sh
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
files=" \
|
||||
methods.md \
|
||||
scopes.md \
|
||||
persistent.md \
|
||||
new.md \
|
||||
converters.md \
|
||||
maybe_types.md \
|
||||
script.md \
|
||||
errors.md \
|
||||
buffers.md \
|
||||
callback.md \
|
||||
asyncworker.md \
|
||||
string_bytes.md \
|
||||
v8_internals.md \
|
||||
v8_misc.md \
|
||||
node_misc.md \
|
||||
"
|
||||
|
||||
__dirname=$(dirname "${BASH_SOURCE[0]}")
|
||||
head=$(perl -e 'while (<>) { if (!$en){print;} if ($_=~/<!-- START/){$en=1} };' $__dirname/../README.md)
|
||||
tail=$(perl -e 'while (<>) { if ($_=~/<!-- END/){$st=1} if ($st){print;} };' $__dirname/../README.md)
|
||||
apidocs=$(for f in $files; do
|
||||
perl -pe '
|
||||
last if /^<a name/;
|
||||
$_ =~ s/^## /### /;
|
||||
$_ =~ s/<a href="#/<a href="doc\/'$f'#/;
|
||||
' $__dirname/$f;
|
||||
done)
|
||||
|
||||
cat > $__dirname/../README.md << EOF
|
||||
$head
|
||||
|
||||
$apidocs
|
||||
|
||||
$tail
|
||||
EOF
|
||||
97
node_modules/sqlite3/node_modules/nan/doc/asyncworker.md
generated
vendored
Normal file
97
node_modules/sqlite3/node_modules/nan/doc/asyncworker.md
generated
vendored
Normal file
@@ -0,0 +1,97 @@
|
||||
## Asynchronous work helpers
|
||||
|
||||
`Nan::AsyncWorker` and `Nan::AsyncProgressWorker` are helper classes that make working with asynchronous code easier.
|
||||
|
||||
- <a href="#api_nan_async_worker"><b><code>Nan::AsyncWorker</code></b></a>
|
||||
- <a href="#api_nan_async_progress_worker"><b><code>Nan::AsyncProgressWorker</code></b></a>
|
||||
- <a href="#api_nan_async_queue_worker"><b><code>Nan::AsyncQueueWorker</code></b></a>
|
||||
|
||||
<a name="api_nan_async_worker"></a>
|
||||
### Nan::AsyncWorker
|
||||
|
||||
`Nan::AsyncWorker` is an _abstract_ class that you can subclass to have much of the annoying asynchronous queuing and handling taken care of for you. It can even store arbitrary V8 objects for you and have them persist while the asynchronous work is in progress.
|
||||
|
||||
Definition:
|
||||
|
||||
```c++
|
||||
class AsyncWorker {
|
||||
public:
|
||||
explicit AsyncWorker(Callback *callback_);
|
||||
|
||||
virtual ~AsyncWorker();
|
||||
|
||||
virtual void WorkComplete();
|
||||
|
||||
void SaveToPersistent(const char *key, const v8::Local<v8::Value> &value);
|
||||
|
||||
void SaveToPersistent(const v8::Local<v8::String> &key,
|
||||
const v8::Local<v8::Value> &value);
|
||||
|
||||
void SaveToPersistent(uint32_t index,
|
||||
const v8::Local<v8::Value> &value);
|
||||
|
||||
v8::Local<v8::Value> GetFromPersistent(const char *key) const;
|
||||
|
||||
v8::Local<v8::Value> GetFromPersistent(const v8::Local<v8::String> &key) const;
|
||||
|
||||
v8::Local<v8::Value> GetFromPersistent(uint32_t index) const;
|
||||
|
||||
virtual void Execute() = 0;
|
||||
|
||||
uv_work_t request;
|
||||
|
||||
virtual void Destroy();
|
||||
|
||||
protected:
|
||||
Persistent<v8::Object> persistentHandle;
|
||||
|
||||
Callback *callback;
|
||||
|
||||
virtual void HandleOKCallback();
|
||||
|
||||
virtual void HandleErrorCallback();
|
||||
|
||||
void SetErrorMessage(const char *msg);
|
||||
|
||||
const char* ErrorMessage();
|
||||
};
|
||||
```
|
||||
|
||||
<a name="api_nan_async_progress_worker"></a>
|
||||
### Nan::AsyncProgressWorker
|
||||
|
||||
`Nan::AsyncProgressWorker` is an _abstract_ class that extends `Nan::AsyncWorker` and adds additional progress reporting callbacks that can be used during the asynchronous work execution to provide progress data back to JavaScript.
|
||||
|
||||
Definition:
|
||||
|
||||
```c++
|
||||
class AsyncProgressWorker : public AsyncWorker {
|
||||
public:
|
||||
explicit AsyncProgressWorker(Callback *callback_);
|
||||
|
||||
virtual ~AsyncProgressWorker();
|
||||
|
||||
void WorkProgress();
|
||||
|
||||
class ExecutionProgress {
|
||||
public:
|
||||
void Send(const char* data, size_t size) const;
|
||||
};
|
||||
|
||||
virtual void Execute(const ExecutionProgress& progress) = 0;
|
||||
|
||||
virtual void HandleProgressCallback(const char *data, size_t size) = 0;
|
||||
|
||||
virtual void Destroy();
|
||||
```
|
||||
|
||||
<a name="api_nan_async_queue_worker"></a>
|
||||
### Nan::AsyncQueueWorker
|
||||
|
||||
`Nan::AsyncQueueWorker` will run a `Nan::AsyncWorker` asynchronously via libuv. Both the `execute` and `after_work` steps are taken care of for you. Most of the logic for this is embedded in `Nan::AsyncWorker`.
|
||||
|
||||
Definition:
|
||||
|
||||
```c++
|
||||
void AsyncQueueWorker(AsyncWorker *);
|
||||
```
|
||||
54
node_modules/sqlite3/node_modules/nan/doc/buffers.md
generated
vendored
Normal file
54
node_modules/sqlite3/node_modules/nan/doc/buffers.md
generated
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
## Buffers
|
||||
|
||||
NAN's `node::Buffer` helpers exist as the API has changed across supported Node versions. Use these methods to ensure compatibility.
|
||||
|
||||
- <a href="#api_nan_new_buffer"><b><code>Nan::NewBuffer()</code></b></a>
|
||||
- <a href="#api_nan_copy_buffer"><b><code>Nan::CopyBuffer()</code></b></a>
|
||||
- <a href="#api_nan_free_callback"><b><code>Nan::FreeCallback()</code></b></a>
|
||||
|
||||
<a name="api_nan_new_buffer"></a>
|
||||
### Nan::NewBuffer()
|
||||
|
||||
Allocate a new `node::Buffer` object with the specified size and optional data. Calls `node::Buffer::New()`.
|
||||
|
||||
Note that when creating a `Buffer` using `Nan::NewBuffer()` and an existing `char*`, it is assumed that the ownership of the pointer is being transferred to the new `Buffer` for management.
|
||||
When a `node::Buffer` instance is garbage collected and a `FreeCallback` has not been specified, `data` will be disposed of via a call to `free()`.
|
||||
You _must not_ free the memory space manually once you have created a `Buffer` in this way.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
Nan::MaybeLocal<v8::Object> Nan::NewBuffer(uint32_t size)
|
||||
Nan::MaybeLocal<v8::Object> Nan::NewBuffer(char* data, uint32_t size)
|
||||
Nan::MaybeLocal<v8::Object> Nan::NewBuffer(char *data,
|
||||
size_t length,
|
||||
Nan::FreeCallback callback,
|
||||
void *hint)
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_copy_buffer"></a>
|
||||
### Nan::CopyBuffer()
|
||||
|
||||
Similar to [`Nan::NewBuffer()`](#api_nan_new_buffer) except that an implicit memcpy will occur within Node. Calls `node::Buffer::Copy()`.
|
||||
|
||||
Management of the `char*` is left to the user, you should manually free the memory space if necessary as the new `Buffer` will have its own copy.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
Nan::MaybeLocal<v8::Object> Nan::CopyBuffer(const char *data, uint32_t size)
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_free_callback"></a>
|
||||
### Nan::FreeCallback()
|
||||
|
||||
A free callback that can be provided to [`Nan::NewBuffer()`](#api_nan_new_buffer).
|
||||
The supplied callback will be invoked when the `Buffer` undergoes garbage collection.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
typedef void (*FreeCallback)(char *data, void *hint);
|
||||
```
|
||||
52
node_modules/sqlite3/node_modules/nan/doc/callback.md
generated
vendored
Normal file
52
node_modules/sqlite3/node_modules/nan/doc/callback.md
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
## Nan::Callback
|
||||
|
||||
`Nan::Callback` makes it easier to use `v8::Function` handles as callbacks. A class that wraps a `v8::Function` handle, protecting it from garbage collection and making it particularly useful for storage and use across asynchronous execution.
|
||||
|
||||
- <a href="#api_nan_callback"><b><code>Nan::Callback</code></b></a>
|
||||
|
||||
<a name="api_nan_callback"></a>
|
||||
### Nan::Callback
|
||||
|
||||
```c++
|
||||
class Callback {
|
||||
public:
|
||||
Callback();
|
||||
|
||||
explicit Callback(const v8::Local<v8::Function> &fn);
|
||||
|
||||
~Callback();
|
||||
|
||||
bool operator==(const Callback &other) const;
|
||||
|
||||
bool operator!=(const Callback &other) const;
|
||||
|
||||
v8::Local<v8::Function> operator*() const;
|
||||
|
||||
v8::Local<v8::Value> operator()(v8::Local<v8::Object> target,
|
||||
int argc = 0,
|
||||
v8::Local<v8::Value> argv[] = 0) const;
|
||||
|
||||
v8::Local<v8::Value> operator()(int argc = 0,
|
||||
v8::Local<v8::Value> argv[] = 0) const;
|
||||
|
||||
void SetFunction(const v8::Local<v8::Function> &fn);
|
||||
|
||||
v8::Local<v8::Function> GetFunction() const;
|
||||
|
||||
bool IsEmpty() const;
|
||||
|
||||
v8::Local<v8::Value> Call(v8::Local<v8::Object> target,
|
||||
int argc,
|
||||
v8::Local<v8::Value> argv[]) const;
|
||||
|
||||
v8::Local<v8::Value> Call(int argc, v8::Local<v8::Value> argv[]) const;
|
||||
};
|
||||
```
|
||||
|
||||
Example usage:
|
||||
|
||||
```c++
|
||||
v8::Local<v8::Function> function;
|
||||
Nan::Callback callback(function);
|
||||
callback->Call(0, 0);
|
||||
```
|
||||
41
node_modules/sqlite3/node_modules/nan/doc/converters.md
generated
vendored
Normal file
41
node_modules/sqlite3/node_modules/nan/doc/converters.md
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
## Converters
|
||||
|
||||
NAN contains functions that convert `v8::Value`s to other `v8::Value` types and native types. Since type conversion is not guaranteed to succeed, they return `Nan::Maybe` types. These converters can be used in place of `value->ToX()` and `value->XValue()` (where `X` is one of the types, e.g. `Boolean`) in a way that provides a consistent interface across V8 versions. Newer versions of V8 use the new `v8::Maybe` and `v8::MaybeLocal` types for these conversions, older versions don't have this functionality so it is provided by NAN.
|
||||
|
||||
- <a href="#api_nan_to"><b><code>Nan::To()</code></b></a>
|
||||
|
||||
<a name="api_nan_to"></a>
|
||||
### Nan::To()
|
||||
|
||||
Converts a `v8::Local<v8::Value>` to a different subtype of `v8::Value` or to a native data type. Returns a `Nan::MaybeLocal<>` or a `Nan::Maybe<>` accordingly.
|
||||
|
||||
See [maybe_types.md](./maybe_types.md) for more information on `Nan::Maybe` types.
|
||||
|
||||
Signatures:
|
||||
|
||||
```c++
|
||||
// V8 types
|
||||
Nan::MaybeLocal<v8::Boolean> Nan::To<v8::Boolean>(v8::Local<v8::Value> val);
|
||||
Nan::MaybeLocal<v8::Int32> Nan::To<v8::Int32>(v8::Local<v8::Value> val);
|
||||
Nan::MaybeLocal<v8::Integer> Nan::To<v8::Integer>(v8::Local<v8::Value> val);
|
||||
Nan::MaybeLocal<v8::Object> Nan::To<v8::Object>(v8::Local<v8::Value> val);
|
||||
Nan::MaybeLocal<v8::Number> Nan::To<v8::Number>(v8::Local<v8::Value> val);
|
||||
Nan::MaybeLocal<v8::String> Nan::To<v8::String>(v8::Local<v8::Value> val);
|
||||
Nan::MaybeLocal<v8::Uint32> Nan::To<v8::Uint32>(v8::Local<v8::Value> val);
|
||||
|
||||
// Native types
|
||||
Nan::Maybe<bool> Nan::To<bool>(v8::Local<v8::Value> val);
|
||||
Nan::Maybe<double> Nan::To<double>(v8::Local<v8::Value> val);
|
||||
Nan::Maybe<int32_t> Nan::To<int32_t>(v8::Local<v8::Value> val);
|
||||
Nan::Maybe<int64_t> Nan::To<int64_t>(v8::Local<v8::Value> val);
|
||||
Nan::Maybe<uint32_t> Nan::To<uint32_t>(v8::Local<v8::Value> val);
|
||||
```
|
||||
|
||||
### Example
|
||||
|
||||
```c++
|
||||
v8::Local<v8::Value> val;
|
||||
Nan::MaybeLocal<v8::String> str = Nan::To<v8::String>(val);
|
||||
Nan::Maybe<double> d = Nan::To<double>(val);
|
||||
```
|
||||
|
||||
226
node_modules/sqlite3/node_modules/nan/doc/errors.md
generated
vendored
Normal file
226
node_modules/sqlite3/node_modules/nan/doc/errors.md
generated
vendored
Normal file
@@ -0,0 +1,226 @@
|
||||
## Errors
|
||||
|
||||
NAN includes helpers for creating, throwing and catching Errors as much of this functionality varies across the supported versions of V8 and must be abstracted.
|
||||
|
||||
Note that an Error object is simply a specialized form of `v8::Value`.
|
||||
|
||||
Also consult the V8 Embedders Guide section on [Exceptions](https://developers.google.com/v8/embed#exceptions) for more information.
|
||||
|
||||
- <a href="#api_nan_error"><b><code>Nan::Error()</code></b></a>
|
||||
- <a href="#api_nan_range_error"><b><code>Nan::RangeError()</code></b></a>
|
||||
- <a href="#api_nan_reference_error"><b><code>Nan::ReferenceError()</code></b></a>
|
||||
- <a href="#api_nan_syntax_error"><b><code>Nan::SyntaxError()</code></b></a>
|
||||
- <a href="#api_nan_type_error"><b><code>Nan::TypeError()</code></b></a>
|
||||
- <a href="#api_nan_throw_error"><b><code>Nan::ThrowError()</code></b></a>
|
||||
- <a href="#api_nan_throw_range_error"><b><code>Nan::ThrowRangeError()</code></b></a>
|
||||
- <a href="#api_nan_throw_reference_error"><b><code>Nan::ThrowReferenceError()</code></b></a>
|
||||
- <a href="#api_nan_throw_syntax_error"><b><code>Nan::ThrowSyntaxError()</code></b></a>
|
||||
- <a href="#api_nan_throw_type_error"><b><code>Nan::ThrowTypeError()</code></b></a>
|
||||
- <a href="#api_nan_fatal_exception"><b><code>Nan::FatalException()</code></b></a>
|
||||
- <a href="#api_nan_errno_exception"><b><code>Nan::ErrnoException()</code></b></a>
|
||||
- <a href="#api_nan_try_catch"><b><code>Nan::TryCatch</code></b></a>
|
||||
|
||||
|
||||
<a name="api_nan_error"></a>
|
||||
### Nan::Error()
|
||||
|
||||
Create a new Error object using the [v8::Exception](https://v8docs.nodesource.com/io.js-3.0/da/d6a/classv8_1_1_exception.html) class in a way that is compatible across the supported versions of V8.
|
||||
|
||||
Note that an Error object is simply a specialized form of `v8::Value`.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
v8::Local<v8::Value> Nan::Error(const char *msg);
|
||||
v8::Local<v8::Value> Nan::Error(v8::Local<v8::String> msg);
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_range_error"></a>
|
||||
### Nan::RangeError()
|
||||
|
||||
Create a new RangeError object using the [v8::Exception](https://v8docs.nodesource.com/io.js-3.0/da/d6a/classv8_1_1_exception.html) class in a way that is compatible across the supported versions of V8.
|
||||
|
||||
Note that an RangeError object is simply a specialized form of `v8::Value`.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
v8::Local<v8::Value> Nan::RangeError(const char *msg);
|
||||
v8::Local<v8::Value> Nan::RangeError(v8::Local<v8::String> msg);
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_reference_error"></a>
|
||||
### Nan::ReferenceError()
|
||||
|
||||
Create a new ReferenceError object using the [v8::Exception](https://v8docs.nodesource.com/io.js-3.0/da/d6a/classv8_1_1_exception.html) class in a way that is compatible across the supported versions of V8.
|
||||
|
||||
Note that an ReferenceError object is simply a specialized form of `v8::Value`.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
v8::Local<v8::Value> Nan::ReferenceError(const char *msg);
|
||||
v8::Local<v8::Value> Nan::ReferenceError(v8::Local<v8::String> msg);
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_syntax_error"></a>
|
||||
### Nan::SyntaxError()
|
||||
|
||||
Create a new SyntaxError object using the [v8::Exception](https://v8docs.nodesource.com/io.js-3.0/da/d6a/classv8_1_1_exception.html) class in a way that is compatible across the supported versions of V8.
|
||||
|
||||
Note that an SyntaxError object is simply a specialized form of `v8::Value`.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
v8::Local<v8::Value> Nan::SyntaxError(const char *msg);
|
||||
v8::Local<v8::Value> Nan::SyntaxError(v8::Local<v8::String> msg);
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_type_error"></a>
|
||||
### Nan::TypeError()
|
||||
|
||||
Create a new TypeError object using the [v8::Exception](https://v8docs.nodesource.com/io.js-3.0/da/d6a/classv8_1_1_exception.html) class in a way that is compatible across the supported versions of V8.
|
||||
|
||||
Note that an TypeError object is simply a specialized form of `v8::Value`.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
v8::Local<v8::Value> Nan::TypeError(const char *msg);
|
||||
v8::Local<v8::Value> Nan::TypeError(v8::Local<v8::String> msg);
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_throw_error"></a>
|
||||
### Nan::ThrowError()
|
||||
|
||||
Throw an Error object (a specialized `v8::Value` as above) in the current context. If a `msg` is provided, a new Error object will be created.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
void Nan::ThrowError(const char *msg);
|
||||
void Nan::ThrowError(v8::Local<v8::String> msg);
|
||||
void Nan::ThrowError(v8::Local<v8::Value> error);
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_throw_range_error"></a>
|
||||
### Nan::ThrowRangeError()
|
||||
|
||||
Throw an RangeError object (a specialized `v8::Value` as above) in the current context. If a `msg` is provided, a new RangeError object will be created.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
void Nan::ThrowRangeError(const char *msg);
|
||||
void Nan::ThrowRangeError(v8::Local<v8::String> msg);
|
||||
void Nan::ThrowRangeError(v8::Local<v8::Value> error);
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_throw_reference_error"></a>
|
||||
### Nan::ThrowReferenceError()
|
||||
|
||||
Throw an ReferenceError object (a specialized `v8::Value` as above) in the current context. If a `msg` is provided, a new ReferenceError object will be created.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
void Nan::ThrowReferenceError(const char *msg);
|
||||
void Nan::ThrowReferenceError(v8::Local<v8::String> msg);
|
||||
void Nan::ThrowReferenceError(v8::Local<v8::Value> error);
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_throw_syntax_error"></a>
|
||||
### Nan::ThrowSyntaxError()
|
||||
|
||||
Throw an SyntaxError object (a specialized `v8::Value` as above) in the current context. If a `msg` is provided, a new SyntaxError object will be created.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
void Nan::ThrowSyntaxError(const char *msg);
|
||||
void Nan::ThrowSyntaxError(v8::Local<v8::String> msg);
|
||||
void Nan::ThrowSyntaxError(v8::Local<v8::Value> error);
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_throw_type_error"></a>
|
||||
### Nan::ThrowTypeError()
|
||||
|
||||
Throw an TypeError object (a specialized `v8::Value` as above) in the current context. If a `msg` is provided, a new TypeError object will be created.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
void Nan::ThrowTypeError(const char *msg);
|
||||
void Nan::ThrowTypeError(v8::Local<v8::String> msg);
|
||||
void Nan::ThrowTypeError(v8::Local<v8::Value> error);
|
||||
```
|
||||
|
||||
<a name="api_nan_fatal_exception"></a>
|
||||
### Nan::FatalException()
|
||||
|
||||
Replaces `node::FatalException()` which has a different API across supported versions of Node. For use with [`Nan::TryCatch`](#api_nan_try_catch).
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
void Nan::FatalException(const Nan::TryCatch& try_catch);
|
||||
```
|
||||
|
||||
<a name="api_nan_errno_exception"></a>
|
||||
### Nan::ErrnoException()
|
||||
|
||||
Replaces `node::ErrnoException()` which has a different API across supported versions of Node.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
v8::Local<v8::Value> Nan::ErrnoException(int errorno,
|
||||
const char* syscall = NULL,
|
||||
const char* message = NULL,
|
||||
const char* path = NULL);
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_try_catch"></a>
|
||||
### Nan::TryCatch
|
||||
|
||||
A simple wrapper around [`v8::TryCatch`](https://v8docs.nodesource.com/io.js-3.0/d4/dc6/classv8_1_1_try_catch.html) compatible with all supported versions of V8. Can be used as a direct replacement in most cases. See also [`Nan::FatalException()`](#api_nan_fatal_exception) for an internal use compatible with `node::FatalException`.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
class Nan::TryCatch {
|
||||
public:
|
||||
Nan::TryCatch();
|
||||
|
||||
bool HasCaught() const;
|
||||
|
||||
bool CanContinue() const;
|
||||
|
||||
v8::Local<v8::Value> ReThrow();
|
||||
|
||||
v8::Local<v8::Value> Exception() const;
|
||||
|
||||
// Nan::MaybeLocal for older versions of V8
|
||||
v8::MaybeLocal<v8::Value> StackTrace() const;
|
||||
|
||||
v8::Local<v8::Message> Message() const;
|
||||
|
||||
void Reset();
|
||||
|
||||
void SetVerbose(bool value);
|
||||
|
||||
void SetCaptureMessage(bool value);
|
||||
};
|
||||
```
|
||||
|
||||
480
node_modules/sqlite3/node_modules/nan/doc/maybe_types.md
generated
vendored
Normal file
480
node_modules/sqlite3/node_modules/nan/doc/maybe_types.md
generated
vendored
Normal file
@@ -0,0 +1,480 @@
|
||||
## Maybe Types
|
||||
|
||||
The `Nan::MaybeLocal` and `Nan::Maybe` types are monads that encapsulate `v8::Local` handles that _may be empty_.
|
||||
|
||||
* **Maybe Types**
|
||||
- <a href="#api_nan_maybe_local"><b><code>Nan::MaybeLocal</code></b></a>
|
||||
- <a href="#api_nan_maybe"><b><code>Nan::Maybe</code></b></a>
|
||||
- <a href="#api_nan_nothing"><b><code>Nan::Nothing</code></b></a>
|
||||
- <a href="#api_nan_just"><b><code>Nan::Just</code></b></a>
|
||||
* **Maybe Helpers**
|
||||
- <a href="#api_nan_to_detail_string"><b><code>Nan::ToDetailString()</code></b></a>
|
||||
- <a href="#api_nan_to_array_index"><b><code>Nan::ToArrayIndex()</code></b></a>
|
||||
- <a href="#api_nan_equals"><b><code>Nan::Equals()</code></b></a>
|
||||
- <a href="#api_nan_new_instance"><b><code>Nan::NewInstance()</code></b></a>
|
||||
- <a href="#api_nan_get_function"><b><code>Nan::GetFunction()</code></b></a>
|
||||
- <a href="#api_nan_set"><b><code>Nan::Set()</code></b></a>
|
||||
- <a href="#api_nan_force_set"><b><code>Nan::ForceSet()</code></b></a>
|
||||
- <a href="#api_nan_get"><b><code>Nan::Get()</code></b></a>
|
||||
- <a href="#api_nan_get_property_attribute"><b><code>Nan::GetPropertyAttributes()</code></b></a>
|
||||
- <a href="#api_nan_has"><b><code>Nan::Has()</code></b></a>
|
||||
- <a href="#api_nan_delete"><b><code>Nan::Delete()</code></b></a>
|
||||
- <a href="#api_nan_get_property_names"><b><code>Nan::GetPropertyNames()</code></b></a>
|
||||
- <a href="#api_nan_get_own_property_names"><b><code>Nan::GetOwnPropertyNames()</code></b></a>
|
||||
- <a href="#api_nan_set_prototype"><b><code>Nan::SetPrototype()</code></b></a>
|
||||
- <a href="#api_nan_object_proto_to_string"><b><code>Nan::ObjectProtoToString()</code></b></a>
|
||||
- <a href="#api_nan_has_own_property"><b><code>Nan::HasOwnProperty()</code></b></a>
|
||||
- <a href="#api_nan_has_real_named_property"><b><code>Nan::HasRealNamedProperty()</code></b></a>
|
||||
- <a href="#api_nan_has_real_indexed_property"><b><code>Nan::HasRealIndexedProperty()</code></b></a>
|
||||
- <a href="#api_nan_has_real_named_callback_property"><b><code>Nan::HasRealNamedCallbackProperty()</code></b></a>
|
||||
- <a href="#api_nan_get_real_named_property_in_prototype_chain"><b><code>Nan::GetRealNamedPropertyInPrototypeChain()</code></b></a>
|
||||
- <a href="#api_nan_get_real_named_property"><b><code>Nan::GetRealNamedProperty()</code></b></a>
|
||||
- <a href="#api_nan_call_as_function"><b><code>Nan::CallAsFunction()</code></b></a>
|
||||
- <a href="#api_nan_call_as_constructor"><b><code>Nan::CallAsConstructor()</code></b></a>
|
||||
- <a href="#api_nan_get_source_line"><b><code>Nan::GetSourceLine()</code></b></a>
|
||||
- <a href="#api_nan_get_line_number"><b><code>Nan::GetLineNumber()</code></b></a>
|
||||
- <a href="#api_nan_get_start_column"><b><code>Nan::GetStartColumn()</code></b></a>
|
||||
- <a href="#api_nan_get_end_column"><b><code>Nan::GetEndColumn()</code></b></a>
|
||||
- <a href="#api_nan_clone_element_at"><b><code>Nan::CloneElementAt()</code></b></a>
|
||||
|
||||
<a name="api_nan_maybe_local"></a>
|
||||
### Nan::MaybeLocal
|
||||
|
||||
A `Nan::MaybeLocal<T>` is a wrapper around [`v8::Local<T>`](https://v8docs.nodesource.com/io.js-3.0/de/deb/classv8_1_1_local.html) that enforces a check that determines whether the `v8::Local<T>` is empty before it can be used.
|
||||
|
||||
If an API method returns a `Nan::MaybeLocal`, the API method can potentially fail either because an exception is thrown, or because an exception is pending, e.g. because a previous API call threw an exception that hasn't been caught yet, or because a `v8::TerminateExecution` exception was thrown. In that case, an empty `Nan::MaybeLocal` is returned.
|
||||
|
||||
Definition:
|
||||
|
||||
```c++
|
||||
template<typename T> class Nan::MaybeLocal {
|
||||
public:
|
||||
MaybeLocal();
|
||||
|
||||
template<typename S> MaybeLocal(v8::Local<S> that);
|
||||
|
||||
bool IsEmpty() const;
|
||||
|
||||
template<typename S> bool ToLocal(v8::Local<S> *out);
|
||||
|
||||
// Will crash if the MaybeLocal<> is empty.
|
||||
v8::Local<T> ToLocalChecked();
|
||||
|
||||
template<typename S> v8::Local<S> FromMaybe(v8::Local<S> default_value) const;
|
||||
};
|
||||
```
|
||||
|
||||
See the documentation for [`v8::MaybeLocal`](https://v8docs.nodesource.com/io.js-3.0/d8/d7d/classv8_1_1_maybe_local.html) for further details.
|
||||
|
||||
<a name="api_nan_maybe"></a>
|
||||
### Nan::Maybe
|
||||
|
||||
A simple `Nan::Maybe` type, representing an object which may or may not have a value, see https://hackage.haskell.org/package/base/docs/Data-Maybe.html.
|
||||
|
||||
If an API method returns a `Nan::Maybe<>`, the API method can potentially fail either because an exception is thrown, or because an exception is pending, e.g. because a previous API call threw an exception that hasn't been caught yet, or because a `v8::TerminateExecution` exception was thrown. In that case, a "Nothing" value is returned.
|
||||
|
||||
Definition:
|
||||
|
||||
```c++
|
||||
template<typename T> class Nan::Maybe {
|
||||
public:
|
||||
bool IsNothing() const;
|
||||
bool IsJust() const;
|
||||
|
||||
// Will crash if the Maybe<> is nothing.
|
||||
T FromJust();
|
||||
|
||||
T FromMaybe(const T& default_value);
|
||||
|
||||
bool operator==(const Maybe &other);
|
||||
|
||||
bool operator!=(const Maybe &other);
|
||||
};
|
||||
```
|
||||
|
||||
See the documentation for [`v8::Maybe`](https://v8docs.nodesource.com/io.js-3.0/d9/d4b/classv8_1_1_maybe.html) for further details.
|
||||
|
||||
<a name="api_nan_nothing"></a>
|
||||
### Nan::Nothing
|
||||
|
||||
Construct an empty `Nan::Maybe` type representing _nothing_.
|
||||
|
||||
```c++
|
||||
template<typename T> Nan::Maybe<T> Nan::Nothing();
|
||||
```
|
||||
|
||||
<a name="api_nan_just"></a>
|
||||
### Nan::Just
|
||||
|
||||
Construct a `Nan::Maybe` type representing _just_ a value.
|
||||
|
||||
```c++
|
||||
template<typename T> Nan::Maybe<T> Nan::Just(const T &t);
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_to_detail_string"></a>
|
||||
### Nan::ToDetailString()
|
||||
|
||||
A helper method for calling [`v8::Value#ToDetailString()`](https://v8docs.nodesource.com/io.js-3.0/dc/d0a/classv8_1_1_value.html#a2f9770296dc2c8d274bc8cc0dca243e5) in a way compatible across supported versions of V8.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
Nan::MaybeLocal<v8::String> Nan::ToDetailString(v8::Local<v8::Value> val);
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_to_array_index"></a>
|
||||
### Nan::ToArrayIndex()
|
||||
|
||||
A helper method for calling [`v8::Value#ToArrayIndex()`](https://v8docs.nodesource.com/io.js-3.0/dc/d0a/classv8_1_1_value.html#acc5bbef3c805ec458470c0fcd6f13493) in a way compatible across supported versions of V8.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
Nan::MaybeLocal<v8::Uint32> Nan::ToArrayIndex(v8::Local<v8::Value> val);
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_equals"></a>
|
||||
### Nan::Equals()
|
||||
|
||||
A helper method for calling [`v8::Value#Equals()`](https://v8docs.nodesource.com/io.js-3.0/dc/d0a/classv8_1_1_value.html#a0d9616ab2de899d4e3047c30a10c9285) in a way compatible across supported versions of V8.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
Nan::Maybe<bool> Nan::Equals(v8::Local<v8::Value> a, v8::Local<v8::Value>(b));
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_new_instance"></a>
|
||||
### Nan::NewInstance()
|
||||
|
||||
A helper method for calling [`v8::Function#NewInstance()`](https://v8docs.nodesource.com/io.js-3.0/d5/d54/classv8_1_1_function.html#a691b13f7a553069732cbacf5ac8c62ec) and [`v8::ObjectTemplate#NewInstance()`](https://v8docs.nodesource.com/io.js-3.0/db/d5f/classv8_1_1_object_template.html#ad605a7543cfbc5dab54cdb0883d14ae4) in a way compatible across supported versions of V8.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
Nan::MaybeLocal<v8::Object> Nan::NewInstance(v8::Local<v8::Function> h);
|
||||
Nan::MaybeLocal<v8::Object> Nan::NewInstance(v8::Local<v8::Function> h, int argc, v8::Local<v8::Value> argv[]);
|
||||
Nan::MaybeLocal<v8::Object> Nan::NewInstance(v8::Local<v8::ObjectTemplate> h);
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_get_function"></a>
|
||||
### Nan::GetFunction()
|
||||
|
||||
A helper method for calling [`v8::FunctionTemplate#GetFunction()`](https://v8docs.nodesource.com/io.js-3.0/d8/d83/classv8_1_1_function_template.html#a56d904662a86eca78da37d9bb0ed3705) in a way compatible across supported versions of V8.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
Nan::MaybeLocal<v8::Function> Nan::GetFunction(v8::Local<v8::FunctionTemplate> t);
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_set"></a>
|
||||
### Nan::Set()
|
||||
|
||||
A helper method for calling [`v8::Object#Set()`](https://v8docs.nodesource.com/io.js-3.0/db/d85/classv8_1_1_object.html#a67604ea3734f170c66026064ea808f20) in a way compatible across supported versions of V8.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
Nan::Maybe<bool> Nan::Set(v8::Local<v8::Object> obj,
|
||||
v8::Local<v8::Value> key,
|
||||
v8::Local<v8::Value> value)
|
||||
Nan::Maybe<bool> Nan::Set(v8::Local<v8::Object> obj,
|
||||
uint32_t index,
|
||||
v8::Local<v8::Value> value);
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_force_set"></a>
|
||||
### Nan::ForceSet()
|
||||
|
||||
A helper method for calling [`v8::Object#ForceSet()`](https://v8docs.nodesource.com/io.js-3.0/db/d85/classv8_1_1_object.html#a796b7b682896fb64bf1872747734e836) in a way compatible across supported versions of V8.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
Nan::Maybe<bool> Nan::ForceSet(v8::Local<v8::Object> obj,
|
||||
v8::Local<v8::Value> key,
|
||||
v8::Local<v8::Value> value,
|
||||
v8::PropertyAttribute attribs = v8::None);
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_get"></a>
|
||||
### Nan::Get()
|
||||
|
||||
A helper method for calling [`v8::Object#Get()`](https://v8docs.nodesource.com/io.js-3.0/db/d85/classv8_1_1_object.html#a2565f03e736694f6b1e1cf22a0b4eac2) in a way compatible across supported versions of V8.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
Nan::MaybeLocal<v8::Value> Nan::Get(v8::Local<v8::Object> obj,
|
||||
v8::Local<v8::Value> key);
|
||||
Nan::MaybeLocal<v8::Value> Nan::Get(v8::Local<v8::Object> obj, uint32_t index);
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_get_property_attribute"></a>
|
||||
### Nan::GetPropertyAttributes()
|
||||
|
||||
A helper method for calling [`v8::Object#GetPropertyAttributes()`](https://v8docs.nodesource.com/io.js-3.0/db/d85/classv8_1_1_object.html#a9b898894da3d1db2714fd9325a54fe57) in a way compatible across supported versions of V8.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
Nan::Maybe<v8::PropertyAttribute> Nan::GetPropertyAttributes(
|
||||
v8::Local<v8::Object> obj,
|
||||
v8::Local<v8::Value> key);
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_has"></a>
|
||||
### Nan::Has()
|
||||
|
||||
A helper method for calling [`v8::Object#Has()`](https://v8docs.nodesource.com/io.js-3.0/db/d85/classv8_1_1_object.html#ab3c3d89ea7c2f9afd08965bd7299a41d) in a way compatible across supported versions of V8.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
Nan::Maybe<bool> Nan::Has(v8::Local<v8::Object> obj, v8::Local<v8::String> key);
|
||||
Nan::Maybe<bool> Nan::Has(v8::Local<v8::Object> obj, uint32_t index);
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_delete"></a>
|
||||
### Nan::Delete()
|
||||
|
||||
A helper method for calling [`v8::Object#Delete()`](https://v8docs.nodesource.com/io.js-3.0/db/d85/classv8_1_1_object.html#a2fa0f5a592582434ed1ceceff7d891ef) in a way compatible across supported versions of V8.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
Nan::Maybe<bool> Nan::Delete(v8::Local<v8::Object> obj,
|
||||
v8::Local<v8::String> key);
|
||||
Nan::Maybe<bool> Nan::Delete(v8::Local<v8::Object> obj, uint32_t index);
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_get_property_names"></a>
|
||||
### Nan::GetPropertyNames()
|
||||
|
||||
A helper method for calling [`v8::Object#GetPropertyNames()`](https://v8docs.nodesource.com/io.js-3.0/db/d85/classv8_1_1_object.html#aced885270cfd2c956367b5eedc7fbfe8) in a way compatible across supported versions of V8.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
Nan::MaybeLocal<v8::Array> Nan::GetPropertyNames(v8::Local<v8::Object> obj);
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_get_own_property_names"></a>
|
||||
### Nan::GetOwnPropertyNames()
|
||||
|
||||
A helper method for calling [`v8::Object#GetOwnPropertyNames()`](https://v8docs.nodesource.com/io.js-3.0/db/d85/classv8_1_1_object.html#a79a6e4d66049b9aa648ed4dfdb23e6eb) in a way compatible across supported versions of V8.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
Nan::MaybeLocal<v8::Array> Nan::GetOwnPropertyNames(v8::Local<v8::Object> obj);
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_set_prototype"></a>
|
||||
### Nan::SetPrototype()
|
||||
|
||||
A helper method for calling [`v8::Object#SetPrototype()`](https://v8docs.nodesource.com/io.js-3.0/db/d85/classv8_1_1_object.html#a442706b22fceda6e6d1f632122a9a9f4) in a way compatible across supported versions of V8.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
Nan::Maybe<bool> Nan::SetPrototype(v8::Local<v8::Object> obj,
|
||||
v8::Local<v8::Value> prototype);
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_object_proto_to_string"></a>
|
||||
### Nan::ObjectProtoToString()
|
||||
|
||||
A helper method for calling [`v8::Object#ObjectProtoToString()`](https://v8docs.nodesource.com/io.js-3.0/db/d85/classv8_1_1_object.html#ab7a92b4dcf822bef72f6c0ac6fea1f0b) in a way compatible across supported versions of V8.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
Nan::MaybeLocal<v8::String> Nan::ObjectProtoToString(v8::Local<v8::Object> obj);
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_has_own_property"></a>
|
||||
### Nan::HasOwnProperty()
|
||||
|
||||
A helper method for calling [`v8::Object#HasOwnProperty()`](https://v8docs.nodesource.com/io.js-3.0/db/d85/classv8_1_1_object.html#ab7b7245442ca6de1e1c145ea3fd653ff) in a way compatible across supported versions of V8.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
Nan::Maybe<bool> Nan::HasOwnProperty(v8::Local<v8::Object> obj,
|
||||
v8::Local<v8::String> key);
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_has_real_named_property"></a>
|
||||
### Nan::HasRealNamedProperty()
|
||||
|
||||
A helper method for calling [`v8::Object#HasRealNamedProperty()`](https://v8docs.nodesource.com/io.js-3.0/db/d85/classv8_1_1_object.html#ad8b80a59c9eb3c1e6c3cd6c84571f767) in a way compatible across supported versions of V8.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
Nan::Maybe<bool> Nan::HasRealNamedProperty(v8::Local<v8::Object> obj,
|
||||
v8::Local<v8::String> key);
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_has_real_indexed_property"></a>
|
||||
### Nan::HasRealIndexedProperty()
|
||||
|
||||
A helper method for calling [`v8::Object#HasRealIndexedProperty()`](https://v8docs.nodesource.com/io.js-3.0/db/d85/classv8_1_1_object.html#af94fc1135a5e74a2193fb72c3a1b9855) in a way compatible across supported versions of V8.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
Nan::Maybe<bool> Nan::HasRealIndexedProperty(v8::Local<v8::Object> obj,
|
||||
uint32_t index);
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_has_real_named_callback_property"></a>
|
||||
### Nan::HasRealNamedCallbackProperty()
|
||||
|
||||
A helper method for calling [`v8::Object#HasRealNamedCallbackProperty()`](https://v8docs.nodesource.com/io.js-3.0/db/d85/classv8_1_1_object.html#af743b7ea132b89f84d34d164d0668811) in a way compatible across supported versions of V8.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
Nan::Maybe<bool> Nan::HasRealNamedCallbackProperty(
|
||||
v8::Local<v8::Object> obj,
|
||||
v8::Local<v8::String> key);
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_get_real_named_property_in_prototype_chain"></a>
|
||||
### Nan::GetRealNamedPropertyInPrototypeChain()
|
||||
|
||||
A helper method for calling [`v8::Object#GetRealNamedPropertyInPrototypeChain()`](https://v8docs.nodesource.com/io.js-3.0/db/d85/classv8_1_1_object.html#a8700b1862e6b4783716964ba4d5e6172) in a way compatible across supported versions of V8.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
Nan::MaybeLocal<v8::Value> Nan::GetRealNamedPropertyInPrototypeChain(
|
||||
v8::Local<v8::Object> obj,
|
||||
v8::Local<v8::String> key);
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_get_real_named_property"></a>
|
||||
### Nan::GetRealNamedProperty()
|
||||
|
||||
A helper method for calling [`v8::Object#GetRealNamedProperty()`](https://v8docs.nodesource.com/io.js-3.0/db/d85/classv8_1_1_object.html#a84471a824576a5994fdd0ffcbf99ccc0) in a way compatible across supported versions of V8.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
Nan::MaybeLocal<v8::Value> Nan::GetRealNamedProperty(v8::Local<v8::Object> obj,
|
||||
v8::Local<v8::String> key);
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_call_as_function"></a>
|
||||
### Nan::CallAsFunction()
|
||||
|
||||
A helper method for calling [`v8::Object#CallAsFunction()`](https://v8docs.nodesource.com/io.js-3.0/db/d85/classv8_1_1_object.html#a9ef18be634e79b4f0cdffa1667a29f58) in a way compatible across supported versions of V8.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
Nan::MaybeLocal<v8::Value> Nan::CallAsFunction(v8::Local<v8::Object> obj,
|
||||
v8::Local<v8::Object> recv,
|
||||
int argc,
|
||||
v8::Local<v8::Value> argv[]);
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_call_as_constructor"></a>
|
||||
### Nan::CallAsConstructor()
|
||||
|
||||
A helper method for calling [`v8::Object#CallAsConstructor()`](https://v8docs.nodesource.com/io.js-3.0/db/d85/classv8_1_1_object.html#a50d571de50d0b0dfb28795619d07a01b) in a way compatible across supported versions of V8.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
Nan::MaybeLocal<v8::Value> Nan::CallAsConstructor(v8::Local<v8::Object> obj,
|
||||
int argc,
|
||||
v8::Local<v8::Value> argv[]);
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_get_source_line"></a>
|
||||
### Nan::GetSourceLine()
|
||||
|
||||
A helper method for calling [`v8::Message#GetSourceLine()`](https://v8docs.nodesource.com/io.js-3.0/d9/d28/classv8_1_1_message.html#a849f7a6c41549d83d8159825efccd23a) in a way compatible across supported versions of V8.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
Nan::MaybeLocal<v8::String> Nan::GetSourceLine(v8::Local<v8::Message> msg);
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_get_line_number"></a>
|
||||
### Nan::GetLineNumber()
|
||||
|
||||
A helper method for calling [`v8::Message#GetLineNumber()`](https://v8docs.nodesource.com/io.js-3.0/d9/d28/classv8_1_1_message.html#adbe46c10a88a6565f2732a2d2adf99b9) in a way compatible across supported versions of V8.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
Nan::Maybe<int> Nan::GetLineNumber(v8::Local<v8::Message> msg);
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_get_start_column"></a>
|
||||
### Nan::GetStartColumn()
|
||||
|
||||
A helper method for calling [`v8::Message#GetStartColumn()`](https://v8docs.nodesource.com/io.js-3.0/d9/d28/classv8_1_1_message.html#a60ede616ba3822d712e44c7a74487ba6) in a way compatible across supported versions of V8.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
Nan::Maybe<int> Nan::GetStartColumn(v8::Local<v8::Message> msg);
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_get_end_column"></a>
|
||||
### Nan::GetEndColumn()
|
||||
|
||||
A helper method for calling [`v8::Message#GetEndColumn()`](https://v8docs.nodesource.com/io.js-3.0/d9/d28/classv8_1_1_message.html#aaa004cf19e529da980bc19fcb76d93be) in a way compatible across supported versions of V8.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
Nan::Maybe<int> Nan::GetEndColumn(v8::Local<v8::Message> msg);
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_clone_element_at"></a>
|
||||
### Nan::CloneElementAt()
|
||||
|
||||
A helper method for calling [`v8::Array#CloneElementAt()`](https://v8docs.nodesource.com/io.js-3.0/d3/d32/classv8_1_1_array.html#a1d3a878d4c1c7cae974dd50a1639245e) in a way compatible across supported versions of V8.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
Nan::MaybeLocal<v8::Object> Nan::CloneElementAt(v8::Local<v8::Array> array, uint32_t index);
|
||||
```
|
||||
624
node_modules/sqlite3/node_modules/nan/doc/methods.md
generated
vendored
Normal file
624
node_modules/sqlite3/node_modules/nan/doc/methods.md
generated
vendored
Normal file
@@ -0,0 +1,624 @@
|
||||
## JavaScript-accessible methods
|
||||
|
||||
A _template_ is a blueprint for JavaScript functions and objects in a context. You can use a template to wrap C++ functions and data structures within JavaScript objects so that they can be manipulated from JavaScript. See the V8 Embedders Guide section on [Templates](https://developers.google.com/v8/embed#templates) for further information.
|
||||
|
||||
In order to expose functionality to JavaScript via a template, you must provide it to V8 in a form that it understands. Across the versions of V8 supported by NAN, JavaScript-accessible method signatures vary widely, NAN fully abstracts method declaration and provides you with an interface that is similar to the most recent V8 API but is backward-compatible with older versions that still use the now-deceased `v8::Argument` type.
|
||||
|
||||
* **Method argument types**
|
||||
- <a href="#api_nan_function_callback_info"><b><code>Nan::FunctionCallbackInfo</code></b></a>
|
||||
- <a href="#api_nan_property_callback_info"><b><code>Nan::PropertyCallbackInfo</code></b></a>
|
||||
- <a href="#api_nan_return_value"><b><code>Nan::ReturnValue</code></b></a>
|
||||
* **Method declarations**
|
||||
- <a href="#api_nan_method"><b>Method declaration</b></a>
|
||||
- <a href="#api_nan_getter"><b>Getter declaration</b></a>
|
||||
- <a href="#api_nan_setter"><b>Setter declaration</b></a>
|
||||
- <a href="#api_nan_property_getter"><b>Property getter declaration</b></a>
|
||||
- <a href="#api_nan_property_setter"><b>Property setter declaration</b></a>
|
||||
- <a href="#api_nan_property_enumerator"><b>Property enumerator declaration</b></a>
|
||||
- <a href="#api_nan_property_deleter"><b>Property deleter declaration</b></a>
|
||||
- <a href="#api_nan_property_query"><b>Property query declaration</b></a>
|
||||
- <a href="#api_nan_index_getter"><b>Index getter declaration</b></a>
|
||||
- <a href="#api_nan_index_setter"><b>Index setter declaration</b></a>
|
||||
- <a href="#api_nan_index_enumerator"><b>Index enumerator declaration</b></a>
|
||||
- <a href="#api_nan_index_deleter"><b>Index deleter declaration</b></a>
|
||||
- <a href="#api_nan_index_query"><b>Index query declaration</b></a>
|
||||
* Method and template helpers
|
||||
- <a href="#api_nan_set_method"><b><code>Nan::SetMethod()</code></b></a>
|
||||
- <a href="#api_nan_set_named_property_handler"><b><code>Nan::SetNamedPropertyHandler()</code></b></a>
|
||||
- <a href="#api_nan_set_indexed_property_handler"><b><code>Nan::SetIndexedPropertyHandler()</code></b></a>
|
||||
- <a href="#api_nan_set_prototype_method"><b><code>Nan::SetPrototypeMethod()</code></b></a>
|
||||
- <a href="#api_nan_set_template"><b><code>Nan::SetTemplate()</code></b></a>
|
||||
- <a href="#api_nan_set_prototype_template"><b><code>Nan::SetPrototypeTemplate()</code></b></a>
|
||||
- <a href="#api_nan_set_instance_template"><b><code>Nan::SetInstanceTemplate()</code></b></a>
|
||||
|
||||
<a name="api_nan_function_callback_info"></a>
|
||||
### Nan::FunctionCallbackInfo
|
||||
|
||||
`Nan::FunctionCallbackInfo` should be used in place of [`v8::FunctionCallbackInfo`](https://v8docs.nodesource.com/io.js-3.0/dd/d0d/classv8_1_1_function_callback_info.html), even with older versions of Node where `v8::FunctionCallbackInfo` does not exist.
|
||||
|
||||
Definition:
|
||||
|
||||
```c++
|
||||
template<typename T> class FunctionCallbackInfo {
|
||||
public:
|
||||
ReturnValue<T> GetReturnValue() const;
|
||||
v8::Local<v8::Function> Callee();
|
||||
v8::Local<v8::Value> Data();
|
||||
v8::Local<v8::Object> Holder();
|
||||
bool IsConstructCall();
|
||||
int Length() const;
|
||||
v8::Local<v8::Value> operator[](int i) const;
|
||||
v8::Local<v8::Object> This() const;
|
||||
v8::Isolate *GetIsolate() const;
|
||||
};
|
||||
```
|
||||
|
||||
See the [`v8::FunctionCallbackInfo`](https://v8docs.nodesource.com/io.js-3.0/dd/d0d/classv8_1_1_function_callback_info.html) documentation for usage details on these. See [`Nan::ReturnValue`](#api_nan_return_value) for further information on how to set a return value from methods.
|
||||
|
||||
<a name="api_nan_property_callback_info"></a>
|
||||
### Nan::PropertyCallbackInfo
|
||||
|
||||
`Nan::PropertyCallbackInfo` should be used in place of [`v8::PropertyCallbackInfo`](https://v8docs.nodesource.com/io.js-3.0/d7/dc5/classv8_1_1_property_callback_info.html), even with older versions of Node where `v8::PropertyCallbackInfo` does not exist.
|
||||
|
||||
Definition:
|
||||
|
||||
```c++
|
||||
template<typename T> class PropertyCallbackInfo : public PropertyCallbackInfoBase<T> {
|
||||
public:
|
||||
ReturnValue<T> GetReturnValue() const;
|
||||
v8::Isolate* GetIsolate() const;
|
||||
v8::Local<v8::Value> Data() const;
|
||||
v8::Local<v8::Object> This() const;
|
||||
v8::Local<v8::Object> Holder() const;
|
||||
};
|
||||
```
|
||||
|
||||
See the [`v8::PropertyCallbackInfo](https://v8docs.nodesource.com/io.js-3.0/d7/dc5/classv8_1_1_property_callback_info.html) documentation for usage details on these. See [`Nan::ReturnValue`](#api_nan_return_value) for further information on how to set a return value from property accessor methods.
|
||||
|
||||
<a name="api_nan_return_value"></a>
|
||||
### Nan::ReturnValue
|
||||
|
||||
`Nan::ReturnValue` is used in place of [`v8::ReturnValue`](https://v8docs.nodesource.com/io.js-3.0/da/da7/classv8_1_1_return_value.html) on both [`Nan::FunctionCallbackInfo`](#api_nan_function_callback_info) and [`Nan::PropertyCallbackInfo`](#api_nan_property_callback_info) as the return type of `GetReturnValue()`.
|
||||
|
||||
Example usage:
|
||||
|
||||
```c++
|
||||
void EmptyArray(const Nan::FunctionCallbackInfo<v8::Value>& info) {
|
||||
info.GetReturnValue().Set(Nan::New<v8::Array>());
|
||||
}
|
||||
```
|
||||
|
||||
Definition:
|
||||
|
||||
```c++
|
||||
template<typename T> class ReturnValue {
|
||||
public:
|
||||
// Handle setters
|
||||
template <typename S> void Set(const v8::Local<S> &handle);
|
||||
template <typename S> void Set(const Nan::Global<S> &handle);
|
||||
|
||||
// Fast primitive setters
|
||||
void Set(bool value);
|
||||
void Set(double i);
|
||||
void Set(int32_t i);
|
||||
void Set(uint32_t i);
|
||||
|
||||
// Fast JS primitive setters
|
||||
void SetNull();
|
||||
void SetUndefined();
|
||||
void SetEmptyString();
|
||||
|
||||
// Convenience getter for isolate
|
||||
v8::Isolate *GetIsolate() const;
|
||||
};
|
||||
```
|
||||
|
||||
See the documentation on [`v8::ReturnValue`](https://v8docs.nodesource.com/io.js-3.0/da/da7/classv8_1_1_return_value.html) for further information on this.
|
||||
|
||||
<a name="api_nan_method"></a>
|
||||
### Method declaration
|
||||
|
||||
JavaScript-accessible methods should be declared with the following signature to form a `Nan::FunctionCallback`:
|
||||
|
||||
```c++
|
||||
typedef void(*FunctionCallback)(const FunctionCallbackInfo<v8::Value>&);
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```c++
|
||||
void MethodName(const Nan::FunctionCallbackInfo<v8::Value>& info) {
|
||||
...
|
||||
}
|
||||
|
||||
You do not need to declare a new `HandleScope` within a method as one is implicitly created for you.
|
||||
|
||||
**Example usage**
|
||||
|
||||
```c++
|
||||
// .h:
|
||||
class Foo : public Nan::ObjectWrap {
|
||||
...
|
||||
|
||||
static void Bar(const Nan::FunctionCallbackInfo<v8::Value>& info);
|
||||
static void Baz(const Nan::FunctionCallbackInfo<v8::Value>& info);
|
||||
}
|
||||
|
||||
|
||||
// .cc:
|
||||
void Foo::Bar(const Nan::FunctionCallbackInfo<v8::Value>& info) {
|
||||
...
|
||||
}
|
||||
|
||||
void Foo::Baz(const Nan::FunctionCallbackInfo<v8::Value>& info) {
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
A helper macro `NAN_METHOD(methodname)` exists, compatible with NAN v1 method declarations.
|
||||
|
||||
**Example usage with `NAN_METHOD(methodname)`**
|
||||
|
||||
```c++
|
||||
// .h:
|
||||
class Foo : public Nan::ObjectWrap {
|
||||
...
|
||||
|
||||
static NAN_METHOD(Bar);
|
||||
static NAN_METHOD(Baz);
|
||||
}
|
||||
|
||||
|
||||
// .cc:
|
||||
NAN_METHOD(Foo::Bar) {
|
||||
...
|
||||
}
|
||||
|
||||
NAN_METHOD(Foo::Baz) {
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
Use [`Nan::SetPrototypeMethod`](#api_nan_set_prototype_method) to attach a method to a JavaScript function prototype or [`Nan::SetMethod`](#api_nan_set_method) to attach a method directly on a JavaScript object.
|
||||
|
||||
<a name="api_nan_getter"></a>
|
||||
### Getter declaration
|
||||
|
||||
JavaScript-accessible getters should be declared with the following signature to form a `Nan::GetterCallback`:
|
||||
|
||||
```c++
|
||||
typedef void(*GetterCallback)(v8::Local<v8::String>,
|
||||
const PropertyCallbackInfo<v8::Value>&);
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```c++
|
||||
void GetterName(v8::Local<v8::String> property,
|
||||
const Nan::PropertyCallbackInfo<v8::Value>& info) {
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
You do not need to declare a new `HandleScope` within a getter as one is implicitly created for you.
|
||||
|
||||
A helper macro `NAN_GETTER(methodname)` exists, compatible with NAN v1 method declarations.
|
||||
|
||||
Also see the V8 Embedders Guide documentation on [Accessors](https://developers.google.com/v8/embed#accesssors).
|
||||
|
||||
<a name="api_nan_setter"></a>
|
||||
### Setter declaration
|
||||
|
||||
JavaScript-accessible setters should be declared with the following signature to form a <b><code>Nan::SetterCallback</code></b>:
|
||||
|
||||
```c++
|
||||
typedef void(*SetterCallback)(v8::Local<v8::String>,
|
||||
v8::Local<v8::Value>,
|
||||
const PropertyCallbackInfo<void>&);
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```c++
|
||||
void SetterName(v8::Local<v8::String> property,
|
||||
v8::Local<v8::Value> value,
|
||||
const Nan::PropertyCallbackInfo<v8::Value>& info) {
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
You do not need to declare a new `HandleScope` within a setter as one is implicitly created for you.
|
||||
|
||||
A helper macro `NAN_SETTER(methodname)` exists, compatible with NAN v1 method declarations.
|
||||
|
||||
Also see the V8 Embedders Guide documentation on [Accessors](https://developers.google.com/v8/embed#accesssors).
|
||||
|
||||
<a name="api_nan_property_getter"></a>
|
||||
### Property getter declaration
|
||||
|
||||
JavaScript-accessible property getters should be declared with the following signature to form a <b><code>Nan::PropertyGetterCallback</code></b>:
|
||||
|
||||
```c++
|
||||
typedef void(*PropertyGetterCallback)(v8::Local<v8::String>,
|
||||
const PropertyCallbackInfo<v8::Value>&);
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```c++
|
||||
void PropertyGetterName(v8::Local<v8::String> property,
|
||||
const Nan::PropertyCallbackInfo<v8::Value>& info) {
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
You do not need to declare a new `HandleScope` within a property getter as one is implicitly created for you.
|
||||
|
||||
A helper macro `NAN_PROPERTY_GETTER(methodname)` exists, compatible with NAN v1 method declarations.
|
||||
|
||||
Also see the V8 Embedders Guide documentation on named property [Interceptors](https://developers.google.com/v8/embed#interceptors).
|
||||
|
||||
<a name="api_nan_property_setter"></a>
|
||||
### Property setter declaration
|
||||
|
||||
JavaScript-accessible property setters should be declared with the following signature to form a <b><code>Nan::PropertySetterCallback</code></b>:
|
||||
|
||||
```c++
|
||||
typedef void(*PropertySetterCallback)(v8::Local<v8::String>,
|
||||
v8::Local<v8::Value>,
|
||||
const PropertyCallbackInfo<v8::Value>&);
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```c++
|
||||
void PropertySetterName(v8::Local<v8::String> property,
|
||||
v8::Local<v8::Value> value,
|
||||
const Nan::PropertyCallbackInfo<v8::Value>& info);
|
||||
```
|
||||
|
||||
You do not need to declare a new `HandleScope` within a property setter as one is implicitly created for you.
|
||||
|
||||
A helper macro `NAN_PROPERTY_SETTER(methodname)` exists, compatible with NAN v1 method declarations.
|
||||
|
||||
Also see the V8 Embedders Guide documentation on named property [Interceptors](https://developers.google.com/v8/embed#interceptors).
|
||||
|
||||
<a name="api_nan_property_enumerator"></a>
|
||||
### Property enumerator declaration
|
||||
|
||||
JavaScript-accessible property enumerators should be declared with the following signature to form a <b><code>Nan::PropertyEnumeratorCallback</code></b>:
|
||||
|
||||
```c++
|
||||
typedef void(*PropertyEnumeratorCallback)(const PropertyCallbackInfo<v8::Array>&);
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```c++
|
||||
void PropertyEnumeratorName(const Nan::PropertyCallbackInfo<v8::Array>& info);
|
||||
```
|
||||
|
||||
You do not need to declare a new `HandleScope` within a property enumerator as one is implicitly created for you.
|
||||
|
||||
A helper macro `NAN_PROPERTY_ENUMERATOR(methodname)` exists, compatible with NAN v1 method declarations.
|
||||
|
||||
Also see the V8 Embedders Guide documentation on named property [Interceptors](https://developers.google.com/v8/embed#interceptors).
|
||||
|
||||
<a name="api_nan_property_deleter"></a>
|
||||
### Property deleter declaration
|
||||
|
||||
JavaScript-accessible property deleters should be declared with the following signature to form a <b><code>Nan::PropertyDeleterCallback</code></b>:
|
||||
|
||||
```c++
|
||||
typedef void(*PropertyDeleterCallback)(v8::Local<v8::String>,
|
||||
const PropertyCallbackInfo<v8::Boolean>&);
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```c++
|
||||
void PropertyDeleterName(v8::Local<v8::String> property,
|
||||
const Nan::PropertyCallbackInfo<v8::Boolean>& info);
|
||||
```
|
||||
|
||||
You do not need to declare a new `HandleScope` within a property deleter as one is implicitly created for you.
|
||||
|
||||
A helper macro `NAN_PROPERTY_DELETER(methodname)` exists, compatible with NAN v1 method declarations.
|
||||
|
||||
Also see the V8 Embedders Guide documentation on named property [Interceptors](https://developers.google.com/v8/embed#interceptors).
|
||||
|
||||
<a name="api_nan_property_query"></a>
|
||||
### Property query declaration
|
||||
|
||||
JavaScript-accessible property query methods should be declared with the following signature to form a <b><code>Nan::PropertyQueryCallback</code></b>:
|
||||
|
||||
```c++
|
||||
typedef void(*PropertyQueryCallback)(v8::Local<v8::String>,
|
||||
const PropertyCallbackInfo<v8::Integer>&);
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```c++
|
||||
void PropertyQueryName(v8::Local<v8::String> property,
|
||||
const Nan::PropertyCallbackInfo<v8::Integer>& info);
|
||||
```
|
||||
|
||||
You do not need to declare a new `HandleScope` within a property query method as one is implicitly created for you.
|
||||
|
||||
A helper macro `NAN_PROPERTY_QUERY(methodname)` exists, compatible with NAN v1 method declarations.
|
||||
|
||||
Also see the V8 Embedders Guide documentation on named property [Interceptors](https://developers.google.com/v8/embed#interceptors).
|
||||
|
||||
<a name="api_nan_index_getter"></a>
|
||||
### Index getter declaration
|
||||
|
||||
JavaScript-accessible index getter methods should be declared with the following signature to form a <b><code>Nan::IndexGetterCallback</code></b>:
|
||||
|
||||
```c++
|
||||
typedef void(*IndexGetterCallback)(uint32_t,
|
||||
const PropertyCallbackInfo<v8::Value>&);
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```c++
|
||||
void IndexGetterName(uint32_t index, const PropertyCallbackInfo<v8::Value>& info);
|
||||
```
|
||||
|
||||
You do not need to declare a new `HandleScope` within a index getter as one is implicitly created for you.
|
||||
|
||||
A helper macro `NAN_INDEX_GETTER(methodname)` exists, compatible with NAN v1 method declarations.
|
||||
|
||||
Also see the V8 Embedders Guide documentation on indexed property [Interceptors](https://developers.google.com/v8/embed#interceptors).
|
||||
|
||||
<a name="api_nan_index_setter"></a>
|
||||
### Index setter declaration
|
||||
|
||||
JavaScript-accessible index setter methods should be declared with the following signature to form a <b><code>Nan::IndexSetterCallback</code></b>:
|
||||
|
||||
```c++
|
||||
typedef void(*IndexSetterCallback)(uint32_t,
|
||||
v8::Local<v8::Value>,
|
||||
const PropertyCallbackInfo<v8::Value>&);
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```c++
|
||||
void IndexSetterName(uint32_t index,
|
||||
v8::Local<v8::Value> value,
|
||||
const PropertyCallbackInfo<v8::Value>& info);
|
||||
```
|
||||
|
||||
You do not need to declare a new `HandleScope` within a index setter as one is implicitly created for you.
|
||||
|
||||
A helper macro `NAN_INDEX_SETTER(methodname)` exists, compatible with NAN v1 method declarations.
|
||||
|
||||
Also see the V8 Embedders Guide documentation on indexed property [Interceptors](https://developers.google.com/v8/embed#interceptors).
|
||||
|
||||
<a name="api_nan_index_enumerator"></a>
|
||||
### Index enumerator declaration
|
||||
|
||||
JavaScript-accessible index enumerator methods should be declared with the following signature to form a <b><code>Nan::IndexEnumeratorCallback</code></b>:
|
||||
|
||||
```c++
|
||||
typedef void(*IndexEnumeratorCallback)(const PropertyCallbackInfo<v8::Array>&);
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```c++
|
||||
void IndexEnumeratorName(const PropertyCallbackInfo<v8::Array>& info);
|
||||
```
|
||||
|
||||
You do not need to declare a new `HandleScope` within a index enumerator as one is implicitly created for you.
|
||||
|
||||
A helper macro `NAN_INDEX_ENUMERATOR(methodname)` exists, compatible with NAN v1 method declarations.
|
||||
|
||||
Also see the V8 Embedders Guide documentation on indexed property [Interceptors](https://developers.google.com/v8/embed#interceptors).
|
||||
|
||||
<a name="api_nan_index_deleter"></a>
|
||||
### Index deleter declaration
|
||||
|
||||
JavaScript-accessible index deleter methods should be declared with the following signature to form a <b><code>Nan::IndexDeleterCallback</code></b>:
|
||||
|
||||
```c++
|
||||
typedef void(*IndexDeleterCallback)(uint32_t,
|
||||
const PropertyCallbackInfo<v8::Boolean>&);
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```c++
|
||||
void IndexDeleterName(uint32_t index, const PropertyCallbackInfo<v8::Boolean>& info);
|
||||
```
|
||||
|
||||
You do not need to declare a new `HandleScope` within a index deleter as one is implicitly created for you.
|
||||
|
||||
A helper macro `NAN_INDEX_DELETER(methodname)` exists, compatible with NAN v1 method declarations.
|
||||
|
||||
Also see the V8 Embedders Guide documentation on indexed property [Interceptors](https://developers.google.com/v8/embed#interceptors).
|
||||
|
||||
<a name="api_nan_index_query"></a>
|
||||
### Index query declaration
|
||||
|
||||
JavaScript-accessible index query methods should be declared with the following signature to form a <b><code>Nan::IndexQueryCallback</code></b>:
|
||||
|
||||
```c++
|
||||
typedef void(*IndexQueryCallback)(uint32_t,
|
||||
const PropertyCallbackInfo<v8::Integer>&);
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```c++
|
||||
void IndexQueryName(uint32_t index, const PropertyCallbackInfo<v8::Integer>& info);
|
||||
```
|
||||
|
||||
You do not need to declare a new `HandleScope` within a index query method as one is implicitly created for you.
|
||||
|
||||
A helper macro `NAN_INDEX_QUERY(methodname)` exists, compatible with NAN v1 method declarations.
|
||||
|
||||
Also see the V8 Embedders Guide documentation on indexed property [Interceptors](https://developers.google.com/v8/embed#interceptors).
|
||||
|
||||
<a name="api_nan_set_method"></a>
|
||||
### Nan::SetMethod()
|
||||
|
||||
Sets a method with a given name directly on a JavaScript object where the method has the `Nan::FunctionCallback` signature (see <a href="#api_nan_method">Method declaration</a>).
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
template<typename T> void Nan::SetMethod(const T &recv,
|
||||
const char *name,
|
||||
Nan::FunctionCallback callback)
|
||||
```
|
||||
|
||||
<a name="api_nan_set_prototype_method"></a>
|
||||
### Nan::SetPrototypeMethod()
|
||||
|
||||
Sets a method with a given name on a `FunctionTemplate`'s prototype where the method has the `Nan::FunctionCallback` signature (see <a href="#api_nan_method">Method declaration</a>).
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
void Nan::SetPrototypeMethod(v8::Local<v8::FunctionTemplate> recv,
|
||||
const char* name,
|
||||
Nan::FunctionCallback callback)
|
||||
```
|
||||
|
||||
<a name="api_nan_set_accessor"></a>
|
||||
### Nan::SetAccessor()
|
||||
|
||||
Sets getters and setters for a property with a given name on an `ObjectTemplate` or a plain `Object`. Accepts getters with the `Nan::GetterCallback` signature (see <a href="#api_nan_getter">Getter declaration</a>) and setters with the `Nan::SetterCallback` signature (see <a href="#api_nan_setter">Setter declaration</a>).
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
void SetAccessor(v8::Local<v8::ObjectTemplate> tpl,
|
||||
v8::Local<v8::String> name,
|
||||
Nan::GetterCallback getter,
|
||||
Nan::SetterCallback setter = 0,
|
||||
v8::Local<v8::Value> data = v8::Local<v8::Value>(),
|
||||
v8::AccessControl settings = v8::DEFAULT,
|
||||
v8::PropertyAttribute attribute = v8::None,
|
||||
imp::Sig signature = imp::Sig())
|
||||
bool SetAccessor(v8::Local<v8::Object> obj,
|
||||
v8::Local<v8::String> name,
|
||||
Nan::GetterCallback getter,
|
||||
Nan::SetterCallback setter = 0,
|
||||
v8::Local<v8::Value> data = v8::Local<v8::Value>(),
|
||||
v8::AccessControl settings = v8::DEFAULT,
|
||||
v8::PropertyAttribute attribute = v8::None)
|
||||
```
|
||||
|
||||
See the V8 [`ObjectTemplate#SetAccessor()`](https://v8docs.nodesource.com/io.js-3.0/db/d5f/classv8_1_1_object_template.html#aa90691622f01269c6a11391d372ca0c5) and [`Object#SetAccessor()`](https://v8docs.nodesource.com/io.js-3.0/db/d85/classv8_1_1_object.html#a3f9dee085f5ec346465f1dc924325043) for further information about how to use `Nan::SetAccessor()`.
|
||||
|
||||
<a name="api_nan_set_named_property_handler"></a>
|
||||
### Nan::SetNamedPropertyHandler()
|
||||
|
||||
Sets named property getters, setters, query, deleter and enumerator methods on an `ObjectTemplate`. Accepts:
|
||||
|
||||
* Property getters with the `Nan::PropertyGetterCallback` signature (see <a href="#api_nan_property_getter">Property getter declaration</a>)
|
||||
* Property setters with the `Nan::PropertySetterCallback` signature (see <a href="#api_nan_property_setter">Property setter declaration</a>)
|
||||
* Property query methods with the `Nan::PropertyQueryCallback` signature (see <a href="#api_nan_property_query">Property query declaration</a>)
|
||||
* Property deleters with the `Nan::PropertyDeleterCallback` signature (see <a href="#api_nan_property_deleter">Property deleter declaration</a>)
|
||||
* Property enumerators with the `Nan::PropertyEnumeratorCallback` signature (see <a href="#api_nan_property_enumerator">Property enumerator declaration</a>)
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
void SetNamedPropertyHandler(v8::Local<v8::ObjectTemplate> tpl,
|
||||
Nan::PropertyGetterCallback getter,
|
||||
Nan::PropertySetterCallback setter = 0,
|
||||
Nan::PropertyQueryCallback query = 0,
|
||||
Nan::PropertyDeleterCallback deleter = 0,
|
||||
Nan::PropertyEnumeratorCallback enumerator = 0,
|
||||
v8::Local<v8::Value> data = v8::Local<v8::Value>())
|
||||
```
|
||||
|
||||
See the V8 [`ObjectTemplate#SetNamedPropertyHandler()`](https://v8docs.nodesource.com/io.js-3.0/db/d5f/classv8_1_1_object_template.html#a34d1cc45b642cd131706663801aadd76) for further information about how to use `Nan::SetNamedPropertyHandler()`.
|
||||
|
||||
<a name="api_nan_set_indexed_property_handler"></a>
|
||||
### Nan::SetIndexedPropertyHandler()
|
||||
|
||||
Sets indexed property getters, setters, query, deleter and enumerator methods on an `ObjectTemplate`. Accepts:
|
||||
|
||||
* Indexed property getters with the `Nan::IndexGetterCallback` signature (see <a href="#api_nan_index_getter">Index getter declaration</a>)
|
||||
* Indexed property setters with the `Nan::IndexSetterCallback` signature (see <a href="#api_nan_index_setter">Index setter declaration</a>)
|
||||
* Indexed property query methods with the `Nan::IndexQueryCallback` signature (see <a href="#api_nan_index_query">Index query declaration</a>)
|
||||
* Indexed property deleters with the `Nan::IndexDeleterCallback` signature (see <a href="#api_nan_index_deleter">Index deleter declaration</a>)
|
||||
* Indexed property enumerators with the `Nan::IndexEnumeratorCallback` signature (see <a href="#api_nan_index_enumerator">Index enumerator declaration</a>)
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
void SetIndexedPropertyHandler(v8::Local<v8::ObjectTemplate> tpl,
|
||||
Nan::IndexGetterCallback getter,
|
||||
Nan::IndexSetterCallback setter = 0,
|
||||
Nan::IndexQueryCallback query = 0,
|
||||
Nan::IndexDeleterCallback deleter = 0,
|
||||
Nan::IndexEnumeratorCallback enumerator = 0,
|
||||
v8::Local<v8::Value> data = v8::Local<v8::Value>())
|
||||
```
|
||||
|
||||
See the V8 [`ObjectTemplate#SetIndexedPropertyHandler()`](https://v8docs.nodesource.com/io.js-3.0/db/d5f/classv8_1_1_object_template.html#ac0234cbede45d51778bb5f6a32a9e125) for further information about how to use `Nan::SetIndexedPropertyHandler()`.
|
||||
|
||||
<a name="api_nan_set_template"></a>
|
||||
### Nan::SetTemplate()
|
||||
|
||||
Adds properties on an `Object`'s or `Function`'s template.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
void Nan::SetTemplate(v8::Local<v8::Template> templ,
|
||||
const char *name,
|
||||
v8::Local<v8::Data> value)
|
||||
void Nan::SetTemplate(v8::Local<v8::Template> templ,
|
||||
v8::Local<v8::String> name,
|
||||
v8::Local<v8::Data> value,
|
||||
v8::PropertyAttribute attributes)
|
||||
```
|
||||
|
||||
Calls the `Template`'s [`Set()`](https://v8docs.nodesource.com/io.js-3.0/db/df7/classv8_1_1_template.html#a2db6a56597bf23c59659c0659e564ddf).
|
||||
|
||||
<a name="api_nan_set_prototype_template"></a>
|
||||
### Nan::SetPrototypeTemplate()
|
||||
|
||||
Adds properties on an `Object`'s or `Function`'s prototype template.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
void Nan::SetPrototypeTemplate(v8::Local<v8::FunctionTemplate> templ,
|
||||
const char *name,
|
||||
v8::Local<v8::Data> value)
|
||||
void Nan::SetPrototypeTemplate(v8::Local<v8::FunctionTemplate> templ,
|
||||
v8::Local<v8::String> name,
|
||||
v8::Local<v8::Data> value,
|
||||
v8::PropertyAttribute attributes)
|
||||
```
|
||||
|
||||
Calls the `FunctionTemplate`'s _PrototypeTemplate's_ [`Set()`](https://v8docs.nodesource.com/io.js-3.0/db/df7/classv8_1_1_template.html#a2db6a56597bf23c59659c0659e564ddf).
|
||||
|
||||
<a name="api_nan_set_instance_template"></a>
|
||||
### Nan::SetInstanceTemplate()
|
||||
|
||||
Use to add instance properties on `FunctionTemplate`'s.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
void Nan::SetInstanceTemplate(v8::Local<v8::FunctionTemplate> templ,
|
||||
const char *name,
|
||||
v8::Local<v8::Data> value)
|
||||
void Nan::SetInstanceTemplate(v8::Local<v8::FunctionTemplate> templ,
|
||||
v8::Local<v8::String> name,
|
||||
v8::Local<v8::Data> value,
|
||||
v8::PropertyAttribute attributes)
|
||||
```
|
||||
|
||||
Calls the `FunctionTemplate`'s _InstanceTemplate's_ [`Set()`](https://v8docs.nodesource.com/io.js-3.0/db/df7/classv8_1_1_template.html#a2db6a56597bf23c59659c0659e564ddf).
|
||||
|
||||
141
node_modules/sqlite3/node_modules/nan/doc/new.md
generated
vendored
Normal file
141
node_modules/sqlite3/node_modules/nan/doc/new.md
generated
vendored
Normal file
@@ -0,0 +1,141 @@
|
||||
## New
|
||||
|
||||
NAN provides a `Nan::New()` helper for the creation of new JavaScript objects in a way that's compatible across the supported versions of V8.
|
||||
|
||||
- <a href="#api_nan_new"><b><code>Nan::New()</code></b></a>
|
||||
- <a href="#api_nan_undefined"><b><code>Nan::Undefined()</code></b></a>
|
||||
- <a href="#api_nan_null"><b><code>Nan::Null()</code></b></a>
|
||||
- <a href="#api_nan_true"><b><code>Nan::True()</code></b></a>
|
||||
- <a href="#api_nan_false"><b><code>Nan::False()</code></b></a>
|
||||
- <a href="#api_nan_empty_string"><b><code>Nan::EmptyString()</code></b></a>
|
||||
|
||||
|
||||
<a name="api_nan_new"></a>
|
||||
### Nan::New()
|
||||
|
||||
`Nan::New()` should be used to instantiate new JavaScript objects.
|
||||
|
||||
Refer to the specific V8 type in the [V8 documentation](https://v8docs.nodesource.com/io.js-3.0/d1/d83/classv8_1_1_data.html) for information on the types of arguments required for instantiation.
|
||||
|
||||
Signatures:
|
||||
|
||||
Return types are mostly omitted from the signatures for simplicity. In most cases the type will be contained within a `v8::Local<T>`. The following types will be contained within a `Nan::MaybeLocal<T>`: `v8::String`, `v8::Date`, `v8::RegExp`, `v8::Script`, `v8::UnboundScript`.
|
||||
|
||||
Empty objects:
|
||||
|
||||
```c++
|
||||
Nan::New<T>();
|
||||
```
|
||||
|
||||
Generic single and multiple-argument:
|
||||
|
||||
```c++
|
||||
Nan::New<T>(A0 arg0);
|
||||
Nan::New<T>(A0 arg0, A1 arg1);
|
||||
Nan::New<T>(A0 arg0, A1 arg1, A2 arg2);
|
||||
Nan::New<T>(A0 arg0, A1 arg1, A2 arg2, A3 arg3);
|
||||
```
|
||||
|
||||
For creating `v8::FunctionTemplate` and `v8::Function` objects:
|
||||
|
||||
_The definition of `Nan::FunctionCallback` can be found in the [Method declaration](./methods.md#api_nan_method) documentation._
|
||||
|
||||
```c++
|
||||
Nan::New<T>(Nan::FunctionCallback callback,
|
||||
v8::Local<v8::Value> data = v8::Local<v8::Value>());
|
||||
Nan::New<T>(Nan::FunctionCallback callback,
|
||||
v8::Local<v8::Value> data = v8::Local<v8::Value>(),
|
||||
A2 a2 = A2());
|
||||
```
|
||||
|
||||
Native types:
|
||||
|
||||
```c++
|
||||
v8::Local<v8::Boolean> Nan::New<T>(bool value);
|
||||
v8::Local<v8::Int32> Nan::New<T>(int32_t value);
|
||||
v8::Local<v8::Uint32> Nan::New<T>(uint32_t value);
|
||||
v8::Local<v8::Number> Nan::New<T>(double value);
|
||||
v8::Local<v8::String> Nan::New<T>(std::string const& value);
|
||||
v8::Local<v8::String> Nan::New<T>(const char * value, int length);
|
||||
v8::Local<v8::String> Nan::New<T>(const char * value);
|
||||
v8::Local<v8::String> Nan::New<T>(const uint16_t * value);
|
||||
```
|
||||
|
||||
Specialized types:
|
||||
|
||||
```c++
|
||||
v8::Local<v8::String> Nan::New<T>(v8::String::ExternalStringResource * value);
|
||||
v8::Local<v8::String> Nan::New<T>(Nan::ExternalOneByteStringResource * value);
|
||||
v8::Local<v8::RegExp> Nan::New<T>(v8::Local<v8::String> pattern, v8::RegExp::Flags flags);
|
||||
```
|
||||
|
||||
Note that `Nan::ExternalOneByteStringResource` maps to [`v8::String::ExternalOneByteStringResource`](https://v8docs.nodesource.com/io.js-3.0/d9/db3/classv8_1_1_string_1_1_external_one_byte_string_resource.html), and `v8::String::ExternalAsciiStringResource` in older versions of V8.
|
||||
|
||||
|
||||
<a name="api_nan_undefined"></a>
|
||||
### Nan::Undefined()
|
||||
|
||||
A helper method to reference the `v8::Undefined` object in a way that is compatible across all supported versions of V8.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
v8::Local<v8::Primitive> Nan::Undefined()
|
||||
```
|
||||
|
||||
<a name="api_nan_null"></a>
|
||||
### Nan::Null()
|
||||
|
||||
A helper method to reference the `v8::Null` object in a way that is compatible across all supported versions of V8.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
v8::Local<v8::Primitive> Nan::Null()
|
||||
```
|
||||
|
||||
<a name="api_nan_true"></a>
|
||||
### Nan::True()
|
||||
|
||||
A helper method to reference the `v8::Boolean` object representing the `true` value in a way that is compatible across all supported versions of V8.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
v8::Local<v8::Boolean> Nan::True()
|
||||
```
|
||||
|
||||
<a name="api_nan_false"></a>
|
||||
### Nan::False()
|
||||
|
||||
A helper method to reference the `v8::Boolean` object representing the `false` value in a way that is compatible across all supported versions of V8.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
v8::Local<v8::Boolean> Nan::False()
|
||||
```
|
||||
|
||||
<a name="api_nan_empty_string"></a>
|
||||
### Nan::EmptyString()
|
||||
|
||||
Call [`v8::String::Empty`](https://v8docs.nodesource.com/io.js-3.0/d2/db3/classv8_1_1_string.html#a7c1bc8886115d7ee46f1d571dd6ebc6d) to reference the empty string in a way that is compatible across all supported versions of V8.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
v8::Local<v8::String> Nan::EmptyString()
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_new_one_byte_string"></a>
|
||||
### Nan::NewOneByteString()
|
||||
|
||||
An implementation of [`v8::String::NewFromOneByte()`](https://v8docs.nodesource.com/io.js-3.0/d2/db3/classv8_1_1_string.html#a5264d50b96d2c896ce525a734dc10f09) provided for consistent availability and API across supported versions of V8. Allocates a new string from Latin-1 data.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
Nan::MaybeLocal<v8::String> Nan::NewOneByteString(const uint8_t * value,
|
||||
int length = -1)
|
||||
```
|
||||
114
node_modules/sqlite3/node_modules/nan/doc/node_misc.md
generated
vendored
Normal file
114
node_modules/sqlite3/node_modules/nan/doc/node_misc.md
generated
vendored
Normal file
@@ -0,0 +1,114 @@
|
||||
## Miscellaneous Node Helpers
|
||||
|
||||
- <a href="#api_nan_make_callback"><b><code>Nan::MakeCallback()</code></b></a>
|
||||
- <a href="#api_nan_object_wrap"><b><code>Nan::ObjectWrap</code></b></a>
|
||||
- <a href="#api_nan_module_init"><b><code>NAN_MODULE_INIT()</code></b></a>
|
||||
- <a href="#api_nan_export"><b><code>Nan::Export()</code></b></a>
|
||||
|
||||
|
||||
<a name="api_nan_make_callback"></a>
|
||||
### Nan::MakeCallback()
|
||||
|
||||
Wrappers around `node::MakeCallback()` providing a consistent API across all supported versions of Node.
|
||||
|
||||
Use `MakeCallback()` rather than using `v8::Function#Call()` directly in order to properly process internal Node functionality including domains, async hooks, the microtask queue, and other debugging functionality.
|
||||
|
||||
Signatures:
|
||||
|
||||
```c++
|
||||
v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object> target,
|
||||
v8::Local<v8::Function> func,
|
||||
int argc,
|
||||
v8::Local<v8::Value>* argv);
|
||||
v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object> target,
|
||||
v8::Local<v8::String> symbol,
|
||||
int argc,
|
||||
v8::Local<v8::Value>* argv);
|
||||
v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object> target,
|
||||
const char* method,
|
||||
int argc,
|
||||
v8::Local<v8::Value>* argv);
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_object_wrap"></a>
|
||||
### Nan::ObjectWrap()
|
||||
|
||||
A reimplementation of `node::ObjectWrap` that adds some API not present in older versions of Node. Should be preferred over `node::ObjectWrap` in all cases for consistency.
|
||||
|
||||
See the Node documentation on [Wrapping C++ Objects](https://nodejs.org/api/addons.html#addons_wrapping_c_objects) for more details.
|
||||
|
||||
Definition:
|
||||
|
||||
```c++
|
||||
class ObjectWrap {
|
||||
public:
|
||||
ObjectWrap();
|
||||
|
||||
virtual ~ObjectWrap();
|
||||
|
||||
template <class T>
|
||||
static inline T* Unwrap(v8::Local<v8::Object> handle);
|
||||
|
||||
inline v8::Local<v8::Object> handle();
|
||||
|
||||
inline Nan::Persistent<v8::Object>& persistent();
|
||||
|
||||
protected:
|
||||
inline void Wrap(v8::Local<v8::Object> handle);
|
||||
|
||||
inline void MakeWeak();
|
||||
|
||||
/* Ref() marks the object as being attached to an event loop.
|
||||
* Refed objects will not be garbage collected, even if
|
||||
* all references are lost.
|
||||
*/
|
||||
virtual void Ref();
|
||||
|
||||
/* Unref() marks an object as detached from the event loop. This is its
|
||||
* default state. When an object with a "weak" reference changes from
|
||||
* attached to detached state it will be freed. Be careful not to access
|
||||
* the object after making this call as it might be gone!
|
||||
* (A "weak reference" means an object that only has a
|
||||
* persistant handle.)
|
||||
*
|
||||
* DO NOT CALL THIS FROM DESTRUCTOR
|
||||
*/
|
||||
virtual void Unref();
|
||||
|
||||
int refs_; // ro
|
||||
};
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_module_init"></a>
|
||||
### NAN_MODULE_INIT()
|
||||
|
||||
Used to define the entry point function to a Node add-on. Creates a function with a given `name` that receives a `target` object representing the equivalent of the JavaScript `exports` object.
|
||||
|
||||
See example below.
|
||||
|
||||
<a name="api_nan_export"></a>
|
||||
### Nan::Export()
|
||||
|
||||
A simple helper to register a `v8::FunctionTemplate` from a JavaScript-accessible method (see [Methods](./methods.md)) as a property on an object. Can be used in a way similar to assigning properties to `module.exports` in JavaScript.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
void Export(v8::Local<v8::Object> target, const char *name, Nan::FunctionCallback f)
|
||||
```
|
||||
|
||||
Also available as the shortcut `NAN_EXPORT` macro.
|
||||
|
||||
Example:
|
||||
|
||||
```c++
|
||||
NAN_METHOD(Foo) {
|
||||
...
|
||||
}
|
||||
|
||||
NAN_MODULE_INIT(Init) {
|
||||
NAN_EXPORT(target, Foo);
|
||||
}
|
||||
```
|
||||
292
node_modules/sqlite3/node_modules/nan/doc/persistent.md
generated
vendored
Normal file
292
node_modules/sqlite3/node_modules/nan/doc/persistent.md
generated
vendored
Normal file
@@ -0,0 +1,292 @@
|
||||
## Persistent references
|
||||
|
||||
An object reference that is independent of any `HandleScope` is a _persistent_ reference. Where a `Local` handle only lives as long as the `HandleScope` in which it was allocated, a `Persistent` handle remains valid until it is explicitly disposed.
|
||||
|
||||
Due to the evolution of the V8 API, it is necessary for NAN to provide a wrapper implementation of the `Persistent` classes to supply compatibility across the V8 versions supported.
|
||||
|
||||
- <a href="#api_nan_persistent_base"><b><code>Nan::PersistentBase & v8::PersistentBase</code></b></a>
|
||||
- <a href="#api_nan_non_copyable_persistent_traits"><b><code>Nan::NonCopyablePersistentTraits & v8::NonCopyablePersistentTraits</code></b></a>
|
||||
- <a href="#api_nan_copyable_persistent_traits"><b><code>Nan::CopyablePersistentTraits & v8::CopyablePersistentTraits</code></b></a>
|
||||
- <a href="#api_nan_persistent"><b><code>Nan::Persistent</code></b></a>
|
||||
- <a href="#api_nan_global"><b><code>Nan::Global</code></b></a>
|
||||
- <a href="#api_nan_weak_callback_info"><b><code>Nan::WeakCallbackInfo</code></b></a>
|
||||
- <a href="#api_nan_weak_callback_type"><b><code>Nan::WeakCallbackType</code></b></a>
|
||||
|
||||
Also see the V8 Embedders Guide section on [Handles and Garbage Collection](https://developers.google.com/v8/embed#handles).
|
||||
|
||||
<a name="api_nan_persistent_base"></a>
|
||||
### Nan::PersistentBase & v8::PersistentBase
|
||||
|
||||
A persistent handle contains a reference to a storage cell in V8 which holds an object value and which is updated by the garbage collector whenever the object is moved. A new storage cell can be created using the constructor or `Nan::PersistentBase::Reset()`. Existing handles can be disposed using an argument-less `Nan::PersistentBase::Reset()`.
|
||||
|
||||
Definition:
|
||||
|
||||
_(note: this is implemented as `Nan::PersistentBase` for older versions of V8 and the native `v8::PersistentBase` is used for newer versions of V8)_
|
||||
|
||||
```c++
|
||||
template<typename T> class PersistentBase {
|
||||
public:
|
||||
/**
|
||||
* If non-empty, destroy the underlying storage cell
|
||||
*/
|
||||
void Reset();
|
||||
|
||||
/**
|
||||
* If non-empty, destroy the underlying storage cell and create a new one with
|
||||
* the contents of another if it is also non-empty
|
||||
*/
|
||||
template<typename S> void Reset(const v8::Local<S> &other);
|
||||
|
||||
/**
|
||||
* If non-empty, destroy the underlying storage cell and create a new one with
|
||||
* the contents of another if it is also non-empty
|
||||
*/
|
||||
template<typename S> void Reset(const PersistentBase<S> &other);
|
||||
|
||||
/**
|
||||
* If non-empty, destroy the underlying storage cell
|
||||
* IsEmpty() will return true after this call.
|
||||
*/
|
||||
bool IsEmpty();
|
||||
|
||||
void Empty();
|
||||
|
||||
template<typename S> bool operator==(const PersistentBase<S> &that);
|
||||
|
||||
template<typename S> bool operator==(const v8::Local<S> &that);
|
||||
|
||||
template<typename S> bool operator!=(const PersistentBase<S> &that);
|
||||
|
||||
template<typename S> bool operator!=(const v8::Local<S> &that);
|
||||
|
||||
/**
|
||||
* Install a finalization callback on this object.
|
||||
* NOTE: There is no guarantee as to *when* or even *if* the callback is
|
||||
* invoked. The invocation is performed solely on a best effort basis.
|
||||
* As always, GC-based finalization should *not* be relied upon for any
|
||||
* critical form of resource management! At the moment you can either
|
||||
* specify a parameter for the callback or the location of two internal
|
||||
* fields in the dying object.
|
||||
*/
|
||||
template<typename P>
|
||||
void SetWeak(P *parameter,
|
||||
typename WeakCallbackInfo<P>::Callback callback,
|
||||
WeakCallbackType type);
|
||||
|
||||
void ClearWeak();
|
||||
|
||||
/**
|
||||
* Marks the reference to this object independent. Garbage collector is free
|
||||
* to ignore any object groups containing this object. Weak callback for an
|
||||
* independent handle should not assume that it will be preceded by a global
|
||||
* GC prologue callback or followed by a global GC epilogue callback.
|
||||
*/
|
||||
void MarkIndependent() const;
|
||||
|
||||
bool IsIndependent() const;
|
||||
|
||||
/** Checks if the handle holds the only reference to an object. */
|
||||
bool IsNearDeath() const;
|
||||
|
||||
/** Returns true if the handle's reference is weak. */
|
||||
bool IsWeak() const
|
||||
};
|
||||
```
|
||||
|
||||
See the V8 documentation for [`PersistentBase`](https://v8docs.nodesource.com/io.js-3.0/d4/dca/classv8_1_1_persistent_base.html) for further information.
|
||||
|
||||
<a name="api_nan_non_copyable_persistent_traits"></a>
|
||||
### Nan::NonCopyablePersistentTraits & v8::NonCopyablePersistentTraits
|
||||
|
||||
Default traits for `Nan::Persistent`. This class does not allow use of the a copy constructor or assignment operator. At present `kResetInDestructor` is not set, but that will change in a future version.
|
||||
|
||||
Definition:
|
||||
|
||||
_(note: this is implemented as `Nan::NonCopyablePersistentTraits` for older versions of V8 and the native `v8::NonCopyablePersistentTraits` is used for newer versions of V8)_
|
||||
|
||||
```c++
|
||||
template<typename T> class NonCopyablePersistentTraits {
|
||||
public:
|
||||
typedef Persistent<T, NonCopyablePersistentTraits<T> > NonCopyablePersistent;
|
||||
|
||||
static const bool kResetInDestructor = false;
|
||||
|
||||
template<typename S, typename M>
|
||||
static void Copy(const Persistent<S, M> &source,
|
||||
NonCopyablePersistent *dest);
|
||||
|
||||
template<typename O> static void Uncompilable();
|
||||
};
|
||||
```
|
||||
|
||||
See the V8 documentation for [`NonCopyablePersistentTraits`](https://v8docs.nodesource.com/io.js-3.0/de/d73/classv8_1_1_non_copyable_persistent_traits.html) for further information.
|
||||
|
||||
<a name="api_nan_copyable_persistent_traits"></a>
|
||||
### Nan::CopyablePersistentTraits & v8::CopyablePersistentTraits
|
||||
|
||||
A helper class of traits to allow copying and assignment of `Persistent`. This will clone the contents of storage cell, but not any of the flags, etc..
|
||||
|
||||
Definition:
|
||||
|
||||
_(note: this is implemented as `Nan::CopyablePersistentTraits` for older versions of V8 and the native `v8::NonCopyablePersistentTraits` is used for newer versions of V8)_
|
||||
|
||||
```c++
|
||||
template<typename T>
|
||||
class CopyablePersistentTraits {
|
||||
public:
|
||||
typedef Persistent<T, CopyablePersistentTraits<T> > CopyablePersistent;
|
||||
|
||||
static const bool kResetInDestructor = true;
|
||||
|
||||
template<typename S, typename M>
|
||||
static void Copy(const Persistent<S, M> &source,
|
||||
CopyablePersistent *dest);
|
||||
};
|
||||
```
|
||||
|
||||
See the V8 documentation for [`CopyablePersistentTraits`](https://v8docs.nodesource.com/io.js-3.0/da/d5c/structv8_1_1_copyable_persistent_traits.html) for further information.
|
||||
|
||||
<a name="api_nan_persistent"></a>
|
||||
### Nan::Persistent
|
||||
|
||||
A type of `PersistentBase` which allows copy and assignment. Copy, assignment and destructor behavior is controlled by the traits class `M`.
|
||||
|
||||
Definition:
|
||||
|
||||
```c++
|
||||
template<typename T, typename M = NonCopyablePersistentTraits<T> >
|
||||
class Persistent;
|
||||
|
||||
template<typename T, typename M> class Persistent : public PersistentBase<T> {
|
||||
public:
|
||||
/**
|
||||
* A Persistent with no storage cell.
|
||||
*/
|
||||
Persistent();
|
||||
|
||||
/**
|
||||
* Construct a Persistent from a v8::Local. When the v8::Local is non-empty, a
|
||||
* new storage cell is created pointing to the same object, and no flags are
|
||||
* set.
|
||||
*/
|
||||
template<typename S> Persistent(v8::Local<S> that);
|
||||
|
||||
/**
|
||||
* Construct a Persistent from a Persistent. When the Persistent is non-empty,
|
||||
* a new storage cell is created pointing to the same object, and no flags are
|
||||
* set.
|
||||
*/
|
||||
Persistent(const Persistent &that);
|
||||
|
||||
/**
|
||||
* The copy constructors and assignment operator create a Persistent exactly
|
||||
* as the Persistent constructor, but the Copy function from the traits class
|
||||
* is called, allowing the setting of flags based on the copied Persistent.
|
||||
*/
|
||||
Persistent &operator=(const Persistent &that);
|
||||
|
||||
template <typename S, typename M2>
|
||||
Persistent &operator=(const Persistent<S, M2> &that);
|
||||
|
||||
/**
|
||||
* The destructor will dispose the Persistent based on the kResetInDestructor
|
||||
* flags in the traits class. Since not calling dispose can result in a
|
||||
* memory leak, it is recommended to always set this flag.
|
||||
*/
|
||||
~Persistent();
|
||||
};
|
||||
```
|
||||
|
||||
See the V8 documentation for [`Persistent`](https://v8docs.nodesource.com/io.js-3.0/d2/d78/classv8_1_1_persistent.html) for further information.
|
||||
|
||||
<a name="api_nan_global"></a>
|
||||
### Nan::Global
|
||||
|
||||
A type of `PersistentBase` which has move semantics.
|
||||
|
||||
```c++
|
||||
template<typename T> class Global : public PersistentBase<T> {
|
||||
public:
|
||||
/**
|
||||
* A Global with no storage cell.
|
||||
*/
|
||||
Global();
|
||||
|
||||
/**
|
||||
* Construct a Global from a v8::Local. When the v8::Local is non-empty, a new
|
||||
* storage cell is created pointing to the same object, and no flags are set.
|
||||
*/
|
||||
template<typename S> Global(v8::Local<S> that);
|
||||
/**
|
||||
* Construct a Global from a PersistentBase. When the Persistent is non-empty,
|
||||
* a new storage cell is created pointing to the same object, and no flags are
|
||||
* set.
|
||||
*/
|
||||
template<typename S> Global(const PersistentBase<S> &that);
|
||||
|
||||
/**
|
||||
* Pass allows returning globals from functions, etc.
|
||||
*/
|
||||
Global Pass();
|
||||
};
|
||||
```
|
||||
|
||||
See the V8 documentation for [`Global`](https://v8docs.nodesource.com/io.js-3.0/d5/d40/classv8_1_1_global.html) for further information.
|
||||
|
||||
<a name="api_nan_weak_callback_type"></a>
|
||||
### Nan::WeakCallbackType
|
||||
|
||||
<a name="api_nan_weak_callback_info"></a>
|
||||
### Nan::WeakCallbackInfo
|
||||
|
||||
`Nan::WeakCallbackInfo` is used as an argument when setting a persistent reference as weak. You may need to free any external resources attached to the object. It is a mirror of `v8:WeakCallbackInfo` as found in newer versions of V8.
|
||||
|
||||
Definition:
|
||||
|
||||
```c++
|
||||
template<typename T> class WeakCallbackInfo {
|
||||
public:
|
||||
typedef void (*Callback)(const WeakCallbackInfo<T>& data);
|
||||
|
||||
v8::Isolate *GetIsolate() const;
|
||||
|
||||
/**
|
||||
* Get the parameter that was associated with the weak handle.
|
||||
*/
|
||||
T *GetParameter() const;
|
||||
|
||||
/**
|
||||
* Get pointer from internal field, index can be 0 or 1.
|
||||
*/
|
||||
void *GetInternalField(int index) const;
|
||||
};
|
||||
```
|
||||
|
||||
Example usage:
|
||||
|
||||
```c++
|
||||
void weakCallback(const WeakCallbackInfo<int> &data) {
|
||||
int *parameter = data.GetParameter();
|
||||
delete parameter;
|
||||
}
|
||||
|
||||
Persistent<v8::Object> obj;
|
||||
int *data = new int(0);
|
||||
obj.SetWeak(data, callback, WeakCallbackType::kParameter);
|
||||
```
|
||||
|
||||
See the V8 documentation for [`WeakCallbackInfo`](https://v8docs.nodesource.com/io.js-3.0/d8/d06/classv8_1_1_weak_callback_info.html) for further information.
|
||||
|
||||
<a name="api_nan_weak_callback_type"></a>
|
||||
### Nan::WeakCallbackType
|
||||
|
||||
Represents the type of a weak callback.
|
||||
A weak callback of type `kParameter` makes the supplied parameter to `Nan::PersistentBase::SetWeak` available through `WeakCallbackInfo::GetParameter`.
|
||||
A weak callback of type `kInternalFields` uses up to two internal fields at indices 0 and 1 on the `Nan::PersistentBase<v8::Object>` being made weak.
|
||||
Note that only `v8::Object`s and derivatives can have internal fields.
|
||||
|
||||
Definition:
|
||||
|
||||
```c++
|
||||
enum class WeakCallbackType { kParameter, kInternalFields };
|
||||
```
|
||||
73
node_modules/sqlite3/node_modules/nan/doc/scopes.md
generated
vendored
Normal file
73
node_modules/sqlite3/node_modules/nan/doc/scopes.md
generated
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
## Scopes
|
||||
|
||||
A _local handle_ is a pointer to an object. All V8 objects are accessed using handles, they are necessary because of the way the V8 garbage collector works.
|
||||
|
||||
A handle scope can be thought of as a container for any number of handles. When you've finished with your handles, instead of deleting each one individually you can simply delete their scope.
|
||||
|
||||
The creation of `HandleScope` objects is different across the supported versions of V8. Therefore, NAN provides its own implementations that can be used safely across these.
|
||||
|
||||
- <a href="#api_nan_handle_scope"><b><code>Nan::HandleScope</code></b></a>
|
||||
- <a href="#api_nan_escapable_handle_scope"><b><code>Nan::EscapableHandleScope</code></b></a>
|
||||
|
||||
Also see the V8 Embedders Guide section on [Handles and Garbage Collection](https://developers.google.com/v8/embed#handles).
|
||||
|
||||
<a name="api_nan_handle_scope"></a>
|
||||
### Nan::HandleScope
|
||||
|
||||
A simple wrapper around [`v8::HandleScope`](https://v8docs.nodesource.com/io.js-3.0/d3/d95/classv8_1_1_handle_scope.html).
|
||||
|
||||
Definition:
|
||||
|
||||
```c++
|
||||
class Nan::HandleScope {
|
||||
public:
|
||||
Nan::HandleScope();
|
||||
static int NumberOfHandles();
|
||||
};
|
||||
```
|
||||
|
||||
Allocate a new `Nan::HandleScope` whenever you are creating new V8 JavaScript objects. Note that an implicit `HandleScope` is created for you on JavaScript-accessible methods so you do not need to insert one yourself.
|
||||
|
||||
Example:
|
||||
|
||||
```c++
|
||||
// new object is created, it needs a new scope:
|
||||
void Pointless() {
|
||||
Nan::HandleScope scope;
|
||||
v8::Local<v8::Object> obj = Nan::New<v8::Object>();
|
||||
}
|
||||
|
||||
// JavaScript-accessible method already has a HandleScope
|
||||
NAN_METHOD(Pointless2) {
|
||||
v8::Local<v8::Object> obj = Nan::New<v8::Object>();
|
||||
}
|
||||
```
|
||||
|
||||
<a name="api_nan_escapable_handle_scope"></a>
|
||||
### Nan::EscapableHandleScope
|
||||
|
||||
Similar to [`Nan::HandleScope`](#api_nan_handle_scope) but should be used in cases where a function needs to return a V8 JavaScript type that has been created within it.
|
||||
|
||||
Definition:
|
||||
|
||||
```c++
|
||||
class Nan::EscapableHandleScope {
|
||||
public:
|
||||
Nan::EscapableHandleScope();
|
||||
static int NumberOfHandles();
|
||||
template<typename T> v8::Local<T> Escape(v8::Local<T> value);
|
||||
}
|
||||
```
|
||||
|
||||
Use `Escape(value)` to return the object.
|
||||
|
||||
Example:
|
||||
|
||||
```c++
|
||||
v8::Local<v8::Object> EmptyObj() {
|
||||
Nan::EscapableHandleScope scope;
|
||||
v8::Local<v8::Object> obj = Nan::New<v8::Object>();
|
||||
return scope.Escape(obj);
|
||||
}
|
||||
```
|
||||
|
||||
38
node_modules/sqlite3/node_modules/nan/doc/script.md
generated
vendored
Normal file
38
node_modules/sqlite3/node_modules/nan/doc/script.md
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
## Script
|
||||
|
||||
NAN provides a `v8::Script` helpers as the API has changed over the supported versions of V8.
|
||||
|
||||
- <a href="#api_nan_compile_script"><b><code>Nan::CompileScript()</code></b></a>
|
||||
- <a href="#api_nan_run_script"><b><code>Nan::RunScript()</code></b></a>
|
||||
|
||||
|
||||
<a name="api_nan_compile_script"></a>
|
||||
### Nan::CompileScript()
|
||||
|
||||
A wrapper around [`v8::Script::Compile()`](https://v8docs.nodesource.com/io.js-3.0/da/da5/classv8_1_1_script_compiler.html#a93f5072a0db55d881b969e9fc98e564b).
|
||||
|
||||
Note that `Nan::BoundScript` is an alias for `v8::Script`.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
Nan::MaybeLocal<Nan::BoundScript> Nan::CompileScript(
|
||||
v8::Local<v8::String> s,
|
||||
const v8::ScriptOrigin& origin);
|
||||
Nan::MaybeLocal<Nan::BoundScript> Nan::CompileScript(v8::Local<v8::String> s);
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_run_script"></a>
|
||||
### Nan::RunScript()
|
||||
|
||||
Calls `script->Run()` or `script->BindToCurrentContext()->Run(Nan::GetCurrentContext())`.
|
||||
|
||||
Note that `Nan::BoundScript` is an alias for `v8::Script` and `Nan::UnboundScript` is an alias for `v8::UnboundScript` where available and `v8::Script` on older versions of V8.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
Nan::MaybeLocal<v8::Value> Nan::RunScript(v8::Local<Nan::UnboundScript> script)
|
||||
Nan::MaybeLocal<v8::Value> Nan::RunScript(v8::Local<Nan::BoundScript> script)
|
||||
```
|
||||
62
node_modules/sqlite3/node_modules/nan/doc/string_bytes.md
generated
vendored
Normal file
62
node_modules/sqlite3/node_modules/nan/doc/string_bytes.md
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
## Strings & Bytes
|
||||
|
||||
Miscellaneous string & byte encoding and decoding functionality provided for compatibility across supported versions of V8 and Node. Implemented by NAN to ensure that all encoding types are supported, even for older versions of Node where they are missing.
|
||||
|
||||
- <a href="#api_nan_encoding"><b><code>Nan::Encoding</code></b></a>
|
||||
- <a href="#api_nan_encode"><b><code>Nan::Encode()</code></b></a>
|
||||
- <a href="#api_nan_decode_bytes"><b><code>Nan::DecodeBytes()</code></b></a>
|
||||
- <a href="#api_nan_decode_write"><b><code>Nan::DecodeWrite()</code></b></a>
|
||||
|
||||
|
||||
<a name="api_nan_encoding"></a>
|
||||
### Nan::Encoding
|
||||
|
||||
An enum representing the supported encoding types. A copy of `node::encoding` that is consistent across versions of Node.
|
||||
|
||||
Definition:
|
||||
|
||||
```c++
|
||||
enum Nan::Encoding { ASCII, UTF8, BASE64, UCS2, BINARY, HEX, BUFFER }
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_encode"></a>
|
||||
### Nan::Encode()
|
||||
|
||||
A wrapper around `node::Encode()` that provides a consistent implementation across supported versions of Node.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
v8::Local<v8::Value> Nan::Encode(const void *buf,
|
||||
size_t len,
|
||||
enum Nan::Encoding encoding = BINARY);
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_decode_bytes"></a>
|
||||
### Nan::DecodeBytes()
|
||||
|
||||
A wrapper around `node::DecodeBytes()` that provides a consistent implementation across supported versions of Node.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
ssize_t Nan::DecodeBytes(v8::Local<v8::Value> val,
|
||||
enum Nan::Encoding encoding = BINARY);
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_decode_write"></a>
|
||||
### Nan::DecodeWrite()
|
||||
|
||||
A wrapper around `node::DecodeWrite()` that provides a consistent implementation across supported versions of Node.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
ssize_t Nan::DecodeWrite(char *buf,
|
||||
size_t len,
|
||||
v8::Local<v8::Value> val,
|
||||
enum Nan::Encoding encoding = BINARY);
|
||||
```
|
||||
199
node_modules/sqlite3/node_modules/nan/doc/v8_internals.md
generated
vendored
Normal file
199
node_modules/sqlite3/node_modules/nan/doc/v8_internals.md
generated
vendored
Normal file
@@ -0,0 +1,199 @@
|
||||
## V8 internals
|
||||
|
||||
The hooks to access V8 internals—including GC and statistics—are different across the supported versions of V8, therefore NAN provides its own hooks that call the appropriate V8 methods.
|
||||
|
||||
- <a href="#api_nan_gc_callback"><b><code>NAN_GC_CALLBACK()</code></b></a>
|
||||
- <a href="#api_nan_add_gc_epilogue_callback"><b><code>Nan::AddGCEpilogueCallback()</code></b></a>
|
||||
- <a href="#api_nan_remove_gc_epilogue_callback"><b><code>Nan::RemoveGCEpilogueCallback()</code></b></a>
|
||||
- <a href="#api_nan_add_gc_prologue_callback"><b><code>Nan::AddGCPrologueCallback()</code></b></a>
|
||||
- <a href="#api_nan_remove_gc_prologue_callback"><b><code>Nan::RemoveGCPrologueCallback()</code></b></a>
|
||||
- <a href="#api_nan_get_heap_statistics"><b><code>Nan::GetHeapStatistics()</code></b></a>
|
||||
- <a href="#api_nan_set_counter_function"><b><code>Nan::SetCounterFunction()</code></b></a>
|
||||
- <a href="#api_nan_set_create_histogram_function"><b><code>Nan::SetCreateHistogramFunction()</code></b></a>
|
||||
- <a href="#api_nan_set_add_histogram_sample_function"><b><code>Nan::SetAddHistogramSampleFunction()</code></b></a>
|
||||
- <a href="#api_nan_idle_notification"><b><code>Nan::IdleNotification()</code></b></a>
|
||||
- <a href="#api_nan_low_memory_notification"><b><code>Nan::LowMemoryNotification()</code></b></a>
|
||||
- <a href="#api_nan_context_disposed_notification"><b><code>Nan::ContextDisposedNotification()</code></b></a>
|
||||
- <a href="#api_nan_get_internal_field_pointer"><b><code>Nan::GetInternalFieldPointer()</code></b></a>
|
||||
- <a href="#api_nan_set_internal_field_pointer"><b><code>Nan::SetInternalFieldPointer()</code></b></a>
|
||||
- <a href="#api_nan_adjust_external_memory"><b><code>Nan::AdjustExternalMemory()</code></b></a>
|
||||
|
||||
|
||||
<a name="api_nan_gc_callback"></a>
|
||||
### NAN_GC_CALLBACK(callbackname)
|
||||
|
||||
Use `NAN_GC_CALLBACK` to declare your callbacks for `Nan::AddGCPrologueCallback()` and `Nan::AddGCEpilogueCallback()`. Your new method receives the arguments `v8::GCType type` and `v8::GCCallbackFlags flags`.
|
||||
|
||||
```c++
|
||||
static Nan::Persistent<Function> callback;
|
||||
|
||||
NAN_GC_CALLBACK(gcPrologueCallback) {
|
||||
v8::Local<Value> argv[] = { Nan::New("prologue").ToLocalChecked() };
|
||||
Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(callback), 1, argv);
|
||||
}
|
||||
|
||||
NAN_METHOD(Hook) {
|
||||
callback.Reset(args[0].As<Function>());
|
||||
Nan::AddGCPrologueCallback(gcPrologueCallback);
|
||||
info.GetReturnValue().Set(info.Holder());
|
||||
}
|
||||
```
|
||||
|
||||
<a name="api_nan_add_gc_epilogue_callback"></a>
|
||||
### Nan::AddGCEpilogueCallback()
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
void Nan::AddGCEpilogueCallback(v8::Isolate::GCEpilogueCallback callback, v8::GCType gc_type_filter = v8::kGCTypeAll)
|
||||
```
|
||||
|
||||
Calls V8's [`AddGCEpilogueCallback()`](https://v8docs.nodesource.com/io.js-3.0/d5/dda/classv8_1_1_isolate.html#a90d1860babc76059c62514b422f56960).
|
||||
|
||||
<a name="api_nan_remove_gc_epilogue_callback"></a>
|
||||
### Nan::RemoveGCEpilogueCallback()
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
void Nan::RemoveGCEpilogueCallback(v8::Isolate::GCEpilogueCallback callback)
|
||||
```
|
||||
|
||||
Calls V8's [`RemoveGCEpilogueCallback()`](https://v8docs.nodesource.com/io.js-3.0/d5/dda/classv8_1_1_isolate.html#a05c60859fd4b8e96bfcd451281ed6c7c).
|
||||
|
||||
<a name="api_nan_add_gc_prologue_callback"></a>
|
||||
### Nan::AddGCPrologueCallback()
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
void Nan::AddGCPrologueCallback(v8::Isolate::GCPrologueCallback, v8::GCType gc_type_filter callback)
|
||||
```
|
||||
|
||||
Calls V8's [`AddGCPrologueCallback()`](https://v8docs.nodesource.com/io.js-3.0/d5/dda/classv8_1_1_isolate.html#ab4b87b8f9f8e5bf95eba4009357e001f).
|
||||
|
||||
<a name="api_nan_remove_gc_prologue_callback"></a>
|
||||
### Nan::RemoveGCPrologueCallback()
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
void Nan::RemoveGCPrologueCallback(v8::Isolate::GCPrologueCallback callback)
|
||||
```
|
||||
|
||||
Calls V8's [`RemoveGCEpilogueCallback()`](https://v8docs.nodesource.com/io.js-3.0/d5/dda/classv8_1_1_isolate.html#a9f6c51932811593f81ff30b949124186).
|
||||
|
||||
<a name="api_nan_get_heap_statistics"></a>
|
||||
### Nan::GetHeapStatistics()
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
void Nan::GetHeapStatistics(v8::HeapStatistics *heap_statistics)
|
||||
```
|
||||
|
||||
Calls V8's [`GetHeapStatistics()`](https://v8docs.nodesource.com/io.js-3.0/d5/dda/classv8_1_1_isolate.html#a5593ac74687b713095c38987e5950b34).
|
||||
|
||||
<a name="api_nan_set_counter_function"></a>
|
||||
### Nan::SetCounterFunction()
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
void Nan::SetCounterFunction(v8::CounterLookupCallback cb)
|
||||
```
|
||||
|
||||
Calls V8's [`SetCounterFunction()`](https://v8docs.nodesource.com/io.js-3.0/d5/dda/classv8_1_1_isolate.html#a045d7754e62fa0ec72ae6c259b29af94).
|
||||
|
||||
<a name="api_nan_set_create_histogram_function"></a>
|
||||
### Nan::SetCreateHistogramFunction()
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
void Nan::SetCreateHistogramFunction(v8::CreateHistogramCallback cb)
|
||||
```
|
||||
|
||||
Calls V8's [`SetCreateHistogramFunction()`](https://v8docs.nodesource.com/io.js-3.0/d5/dda/classv8_1_1_isolate.html#a542d67e85089cb3f92aadf032f99e732).
|
||||
|
||||
<a name="api_nan_set_add_histogram_sample_function"></a>
|
||||
### Nan::SetAddHistogramSampleFunction()
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
void Nan::SetAddHistogramSampleFunction(v8::AddHistogramSampleCallback cb)
|
||||
```
|
||||
|
||||
Calls V8's [`SetAddHistogramSampleFunction()`](https://v8docs.nodesource.com/io.js-3.0/d5/dda/classv8_1_1_isolate.html#aeb420b690bc2c216882d6fdd00ddd3ea).
|
||||
|
||||
<a name="api_nan_idle_notification"></a>
|
||||
### Nan::IdleNotification()
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
void Nan::IdleNotification(v8::HeapStatistics *heap_statistics)
|
||||
```
|
||||
|
||||
Calls V8's [`IdleNotification()` or `IdleNotificationDeadline()`](https://v8docs.nodesource.com/io.js-3.0/d5/dda/classv8_1_1_isolate.html#ad6a2a02657f5425ad460060652a5a118) depending on V8 version.
|
||||
|
||||
<a name="api_nan_low_memory_notification"></a>
|
||||
### Nan::LowMemoryNotification()
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
void Nan::LowMemoryNotification()
|
||||
```
|
||||
|
||||
Calls V8's [`IdleNotification()`](https://v8docs.nodesource.com/io.js-3.0/d5/dda/classv8_1_1_isolate.html#a24647f61d6b41f69668094bdcd6ea91f).
|
||||
|
||||
<a name="api_nan_context_disposed_notification"></a>
|
||||
### Nan::ContextDisposedNotification()
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
void Nan::ContextDisposedNotification()
|
||||
```
|
||||
|
||||
Calls V8's [`ContextDisposedNotification()`](https://v8docs.nodesource.com/io.js-3.0/d5/dda/classv8_1_1_isolate.html#ad7f5dc559866343fe6cd8db1f134d48b).
|
||||
|
||||
<a name="api_nan_get_internal_field_pointer"></a>
|
||||
### Nan::GetInternalFieldPointer()
|
||||
|
||||
Gets a pointer to the internal field with at `index` from a V8 `Object` handle.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
void* Nan::GetInternalFieldPointer(v8::Local<v8::Object> object, int index)
|
||||
```
|
||||
|
||||
Calls the Object's [`GetAlignedPointerFromInternalField()` or `GetPointerFromInternalField()`](https://v8docs.nodesource.com/io.js-3.0/db/d85/classv8_1_1_object.html#ab3c57184263cf29963ef0017bec82281) depending on the version of V8.
|
||||
|
||||
<a name="api_nan_set_internal_field_pointer"></a>
|
||||
### Nan::SetInternalFieldPointer()
|
||||
|
||||
Sets the value of the internal field at `index` on a V8 `Object` handle.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
void Nan::SetInternalFieldPointer(v8::Local<v8::Object> object, int index, void* value)
|
||||
```
|
||||
|
||||
Calls the Object's [`SetAlignedPointerInInternalField()` or `SetPointerInInternalField()`](https://v8docs.nodesource.com/io.js-3.0/d5/dda/classv8_1_1_isolate.html#ad7f5dc559866343fe6cd8db1f134d48b) depending on the version of V8.
|
||||
|
||||
<a name="api_nan_adjust_external_memory"></a>
|
||||
### Nan::AdjustExternalMemory()
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
int Nan::AdjustExternalMemory(int bytesChange)
|
||||
```
|
||||
|
||||
Calls V8's [`AdjustAmountOfExternalAllocatedMemory()` or `AdjustAmountOfExternalAllocatedMemory()`](https://v8docs.nodesource.com/io.js-3.0/d5/dda/classv8_1_1_isolate.html#ae1a59cac60409d3922582c4af675473e) depending on the version of V8.
|
||||
|
||||
63
node_modules/sqlite3/node_modules/nan/doc/v8_misc.md
generated
vendored
Normal file
63
node_modules/sqlite3/node_modules/nan/doc/v8_misc.md
generated
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
## Miscellaneous V8 Helpers
|
||||
|
||||
- <a href="#api_nan_utf8_string"><b><code>Nan::Utf8String</code></b></a>
|
||||
- <a href="#api_nan_get_current_context"><b><code>Nan::GetCurrentContext()</code></b></a>
|
||||
- <a href="#api_nan_set_isolate_data"><b><code>Nan::SetIsolateData()</code></b></a>
|
||||
- <a href="#api_nan_get_isolate_data"><b><code>Nan::GetIsolateData()</code></b></a>
|
||||
|
||||
|
||||
<a name="api_nan_utf8_string"></a>
|
||||
### Nan::Utf8String
|
||||
|
||||
Converts an object to a UTF-8-encoded character array. If conversion to a string fails (e.g. due to an exception in the toString() method of the object) then the length() method returns 0 and the * operator returns NULL. The underlying memory used for this object is managed by the object.
|
||||
|
||||
An implementation of [`v8::String::Utf8Value`](https://v8docs.nodesource.com/io.js-3.0/d4/d1b/classv8_1_1_string_1_1_utf8_value.html) that is consistent across all supported versions of V8.
|
||||
|
||||
Definition:
|
||||
|
||||
```c++
|
||||
class Nan::Utf8String {
|
||||
public:
|
||||
Nan::Utf8String(v8::Local<v8::Value> from);
|
||||
|
||||
int length() const;
|
||||
|
||||
char* operator*();
|
||||
const char* operator*() const;
|
||||
};
|
||||
```
|
||||
|
||||
<a name="api_nan_get_current_context"></a>
|
||||
### Nan::GetCurrentContext()
|
||||
|
||||
A call to [`v8::Isolate::GetCurrent()->GetCurrentContext()`](https://v8docs.nodesource.com/io.js-3.0/d5/dda/classv8_1_1_isolate.html#a81c7a1ed7001ae2a65e89107f75fd053) that works across all supported versions of V8.
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
v8::Local<v8::Context> Nan::GetCurrentContext()
|
||||
```
|
||||
|
||||
<a name="api_nan_set_isolate_data"></a>
|
||||
### Nan::SetIsolateData()
|
||||
|
||||
A helper to provide a consistent API to [`v8::Isolate#SetData()`](https://v8docs.nodesource.com/io.js-3.0/d5/dda/classv8_1_1_isolate.html#a7acadfe7965997e9c386a05f098fbe36).
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
void Nan::SetIsolateData(v8::Isolate *isolate, T *data)
|
||||
```
|
||||
|
||||
|
||||
<a name="api_nan_get_isolate_data"></a>
|
||||
### Nan::GetIsolateData()
|
||||
|
||||
A helper to provide a consistent API to [`v8::Isolate#GetData()`](https://v8docs.nodesource.com/io.js-3.0/d5/dda/classv8_1_1_isolate.html#aabd223436bc1100a787dadaa024c6257).
|
||||
|
||||
Signature:
|
||||
|
||||
```c++
|
||||
T *Nan::GetIsolateData(v8::Isolate *isolate)
|
||||
```
|
||||
|
||||
1
node_modules/sqlite3/node_modules/nan/include_dirs.js
generated
vendored
Normal file
1
node_modules/sqlite3/node_modules/nan/include_dirs.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
console.log(require('path').relative('.', __dirname));
|
||||
2136
node_modules/sqlite3/node_modules/nan/nan.h
generated
vendored
Normal file
2136
node_modules/sqlite3/node_modules/nan/nan.h
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
88
node_modules/sqlite3/node_modules/nan/nan_callbacks.h
generated
vendored
Normal file
88
node_modules/sqlite3/node_modules/nan/nan_callbacks.h
generated
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
/*********************************************************************
|
||||
* NAN - Native Abstractions for Node.js
|
||||
*
|
||||
* Copyright (c) 2015 NAN contributors
|
||||
*
|
||||
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
|
||||
********************************************************************/
|
||||
|
||||
#ifndef NAN_CALLBACKS_H_
|
||||
#define NAN_CALLBACKS_H_
|
||||
|
||||
template<typename T> class FunctionCallbackInfo;
|
||||
template<typename T> class PropertyCallbackInfo;
|
||||
template<typename T> class Global;
|
||||
|
||||
typedef void(*FunctionCallback)(const FunctionCallbackInfo<v8::Value>&);
|
||||
typedef void(*GetterCallback)
|
||||
(v8::Local<v8::String>, const PropertyCallbackInfo<v8::Value>&);
|
||||
typedef void(*SetterCallback)(
|
||||
v8::Local<v8::String>,
|
||||
v8::Local<v8::Value>,
|
||||
const PropertyCallbackInfo<void>&);
|
||||
typedef void(*PropertyGetterCallback)(
|
||||
v8::Local<v8::String>,
|
||||
const PropertyCallbackInfo<v8::Value>&);
|
||||
typedef void(*PropertySetterCallback)(
|
||||
v8::Local<v8::String>,
|
||||
v8::Local<v8::Value>,
|
||||
const PropertyCallbackInfo<v8::Value>&);
|
||||
typedef void(*PropertyEnumeratorCallback)
|
||||
(const PropertyCallbackInfo<v8::Array>&);
|
||||
typedef void(*PropertyDeleterCallback)(
|
||||
v8::Local<v8::String>,
|
||||
const PropertyCallbackInfo<v8::Boolean>&);
|
||||
typedef void(*PropertyQueryCallback)(
|
||||
v8::Local<v8::String>,
|
||||
const PropertyCallbackInfo<v8::Integer>&);
|
||||
typedef void(*IndexGetterCallback)(
|
||||
uint32_t,
|
||||
const PropertyCallbackInfo<v8::Value>&);
|
||||
typedef void(*IndexSetterCallback)(
|
||||
uint32_t,
|
||||
v8::Local<v8::Value>,
|
||||
const PropertyCallbackInfo<v8::Value>&);
|
||||
typedef void(*IndexEnumeratorCallback)
|
||||
(const PropertyCallbackInfo<v8::Array>&);
|
||||
typedef void(*IndexDeleterCallback)(
|
||||
uint32_t,
|
||||
const PropertyCallbackInfo<v8::Boolean>&);
|
||||
typedef void(*IndexQueryCallback)(
|
||||
uint32_t,
|
||||
const PropertyCallbackInfo<v8::Integer>&);
|
||||
|
||||
namespace imp {
|
||||
typedef v8::Local<v8::AccessorSignature> Sig;
|
||||
|
||||
static const int kDataIndex = 0;
|
||||
|
||||
static const int kFunctionIndex = 1;
|
||||
static const int kFunctionFieldCount = 2;
|
||||
|
||||
static const int kGetterIndex = 1;
|
||||
static const int kSetterIndex = 2;
|
||||
static const int kAccessorFieldCount = 3;
|
||||
|
||||
static const int kPropertyGetterIndex = 1;
|
||||
static const int kPropertySetterIndex = 2;
|
||||
static const int kPropertyEnumeratorIndex = 3;
|
||||
static const int kPropertyDeleterIndex = 4;
|
||||
static const int kPropertyQueryIndex = 5;
|
||||
static const int kPropertyFieldCount = 6;
|
||||
|
||||
static const int kIndexPropertyGetterIndex = 1;
|
||||
static const int kIndexPropertySetterIndex = 2;
|
||||
static const int kIndexPropertyEnumeratorIndex = 3;
|
||||
static const int kIndexPropertyDeleterIndex = 4;
|
||||
static const int kIndexPropertyQueryIndex = 5;
|
||||
static const int kIndexPropertyFieldCount = 6;
|
||||
|
||||
} // end of namespace imp
|
||||
|
||||
#if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION
|
||||
# include "nan_callbacks_12_inl.h" // NOLINT(build/include)
|
||||
#else
|
||||
# include "nan_callbacks_pre_12_inl.h" // NOLINT(build/include)
|
||||
#endif
|
||||
|
||||
#endif // NAN_CALLBACKS_H_
|
||||
512
node_modules/sqlite3/node_modules/nan/nan_callbacks_12_inl.h
generated
vendored
Normal file
512
node_modules/sqlite3/node_modules/nan/nan_callbacks_12_inl.h
generated
vendored
Normal file
@@ -0,0 +1,512 @@
|
||||
/*********************************************************************
|
||||
* NAN - Native Abstractions for Node.js
|
||||
*
|
||||
* Copyright (c) 2015 NAN contributors
|
||||
*
|
||||
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
|
||||
********************************************************************/
|
||||
|
||||
#ifndef NAN_CALLBACKS_12_INL_H_
|
||||
#define NAN_CALLBACKS_12_INL_H_
|
||||
|
||||
template<typename T>
|
||||
class ReturnValue {
|
||||
v8::ReturnValue<T> value_;
|
||||
|
||||
public:
|
||||
template <class S>
|
||||
explicit inline ReturnValue(const v8::ReturnValue<S> &value) :
|
||||
value_(value) {}
|
||||
template <class S>
|
||||
explicit inline ReturnValue(const ReturnValue<S>& that)
|
||||
: value_(that.value_) {
|
||||
TYPE_CHECK(T, S);
|
||||
}
|
||||
|
||||
// Handle setters
|
||||
template <typename S> inline void Set(const v8::Local<S> &handle) {
|
||||
TYPE_CHECK(T, S);
|
||||
value_.Set(handle);
|
||||
}
|
||||
|
||||
template <typename S> inline void Set(const Global<S> &handle) {
|
||||
TYPE_CHECK(T, S);
|
||||
#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \
|
||||
(V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && \
|
||||
(V8_MINOR_VERSION > 5 || (V8_MINOR_VERSION == 5 && \
|
||||
defined(V8_BUILD_NUMBER) && V8_BUILD_NUMBER >= 8))))
|
||||
value_.Set(handle);
|
||||
#else
|
||||
value_.Set(*reinterpret_cast<const v8::Persistent<S>*>(&handle));
|
||||
const_cast<Global<S> &>(handle).Reset();
|
||||
#endif
|
||||
}
|
||||
|
||||
// Fast primitive setters
|
||||
inline void Set(bool value) {
|
||||
TYPE_CHECK(T, v8::Boolean);
|
||||
value_.Set(value);
|
||||
}
|
||||
|
||||
inline void Set(double i) {
|
||||
TYPE_CHECK(T, v8::Number);
|
||||
value_.Set(i);
|
||||
}
|
||||
|
||||
inline void Set(int32_t i) {
|
||||
TYPE_CHECK(T, v8::Integer);
|
||||
value_.Set(i);
|
||||
}
|
||||
|
||||
inline void Set(uint32_t i) {
|
||||
TYPE_CHECK(T, v8::Integer);
|
||||
value_.Set(i);
|
||||
}
|
||||
|
||||
// Fast JS primitive setters
|
||||
inline void SetNull() {
|
||||
TYPE_CHECK(T, v8::Primitive);
|
||||
value_.SetNull();
|
||||
}
|
||||
|
||||
inline void SetUndefined() {
|
||||
TYPE_CHECK(T, v8::Primitive);
|
||||
value_.SetUndefined();
|
||||
}
|
||||
|
||||
inline void SetEmptyString() {
|
||||
TYPE_CHECK(T, v8::String);
|
||||
value_.SetEmptyString();
|
||||
}
|
||||
|
||||
// Convenience getter for isolate
|
||||
inline v8::Isolate *GetIsolate() const {
|
||||
return value_.GetIsolate();
|
||||
}
|
||||
|
||||
// Pointer setter: Uncompilable to prevent inadvertent misuse.
|
||||
template<typename S>
|
||||
inline void Set(S *whatever) { TYPE_CHECK(S*, v8::Primitive); }
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
class FunctionCallbackInfo {
|
||||
const v8::FunctionCallbackInfo<T> &info_;
|
||||
const v8::Local<v8::Value> data_;
|
||||
|
||||
public:
|
||||
explicit inline FunctionCallbackInfo(
|
||||
const v8::FunctionCallbackInfo<T> &info
|
||||
, v8::Local<v8::Value> data) :
|
||||
info_(info)
|
||||
, data_(data) {}
|
||||
|
||||
inline ReturnValue<T> GetReturnValue() const {
|
||||
return ReturnValue<T>(info_.GetReturnValue());
|
||||
}
|
||||
|
||||
inline v8::Local<v8::Function> Callee() const { return info_.Callee(); }
|
||||
inline v8::Local<v8::Value> Data() const { return data_; }
|
||||
inline v8::Local<v8::Object> Holder() const { return info_.Holder(); }
|
||||
inline bool IsConstructCall() const { return info_.IsConstructCall(); }
|
||||
inline int Length() const { return info_.Length(); }
|
||||
inline v8::Local<v8::Value> operator[](int i) const { return info_[i]; }
|
||||
inline v8::Local<v8::Object> This() const { return info_.This(); }
|
||||
inline v8::Isolate *GetIsolate() const { return info_.GetIsolate(); }
|
||||
|
||||
|
||||
protected:
|
||||
static const int kHolderIndex = 0;
|
||||
static const int kIsolateIndex = 1;
|
||||
static const int kReturnValueDefaultValueIndex = 2;
|
||||
static const int kReturnValueIndex = 3;
|
||||
static const int kDataIndex = 4;
|
||||
static const int kCalleeIndex = 5;
|
||||
static const int kContextSaveIndex = 6;
|
||||
static const int kArgsLength = 7;
|
||||
|
||||
private:
|
||||
NAN_DISALLOW_ASSIGN_COPY_MOVE(FunctionCallbackInfo)
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
class PropertyCallbackInfo {
|
||||
const v8::PropertyCallbackInfo<T> &info_;
|
||||
const v8::Local<v8::Value> data_;
|
||||
|
||||
public:
|
||||
explicit inline PropertyCallbackInfo(
|
||||
const v8::PropertyCallbackInfo<T> &info
|
||||
, const v8::Local<v8::Value> &data) :
|
||||
info_(info)
|
||||
, data_(data) {}
|
||||
|
||||
inline v8::Isolate* GetIsolate() const { return info_.GetIsolate(); }
|
||||
inline v8::Local<v8::Value> Data() const { return data_; }
|
||||
inline v8::Local<v8::Object> This() const { return info_.This(); }
|
||||
inline v8::Local<v8::Object> Holder() const { return info_.Holder(); }
|
||||
inline ReturnValue<T> GetReturnValue() const {
|
||||
return ReturnValue<T>(info_.GetReturnValue());
|
||||
}
|
||||
|
||||
protected:
|
||||
static const int kHolderIndex = 0;
|
||||
static const int kIsolateIndex = 1;
|
||||
static const int kReturnValueDefaultValueIndex = 2;
|
||||
static const int kReturnValueIndex = 3;
|
||||
static const int kDataIndex = 4;
|
||||
static const int kThisIndex = 5;
|
||||
static const int kArgsLength = 6;
|
||||
|
||||
private:
|
||||
NAN_DISALLOW_ASSIGN_COPY_MOVE(PropertyCallbackInfo)
|
||||
};
|
||||
|
||||
namespace imp {
|
||||
static
|
||||
void FunctionCallbackWrapper(const v8::FunctionCallbackInfo<v8::Value> &info) {
|
||||
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
|
||||
FunctionCallback callback = reinterpret_cast<FunctionCallback>(
|
||||
reinterpret_cast<intptr_t>(
|
||||
obj->GetInternalField(kFunctionIndex).As<v8::External>()->Value()));
|
||||
FunctionCallbackInfo<v8::Value>
|
||||
cbinfo(info, obj->GetInternalField(kDataIndex));
|
||||
callback(cbinfo);
|
||||
}
|
||||
|
||||
typedef void (*NativeFunction)(const v8::FunctionCallbackInfo<v8::Value> &);
|
||||
|
||||
#if NODE_MODULE_VERSION > NODE_0_12_MODULE_VERSION
|
||||
static
|
||||
void GetterCallbackWrapper(
|
||||
v8::Local<v8::Name> property
|
||||
, const v8::PropertyCallbackInfo<v8::Value> &info) {
|
||||
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
|
||||
PropertyCallbackInfo<v8::Value>
|
||||
cbinfo(info, obj->GetInternalField(kDataIndex));
|
||||
GetterCallback callback = reinterpret_cast<GetterCallback>(
|
||||
reinterpret_cast<intptr_t>(
|
||||
obj->GetInternalField(kGetterIndex).As<v8::External>()->Value()));
|
||||
callback(property.As<v8::String>(), cbinfo);
|
||||
}
|
||||
|
||||
typedef void (*NativeGetter)
|
||||
(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value> &);
|
||||
|
||||
static
|
||||
void SetterCallbackWrapper(
|
||||
v8::Local<v8::Name> property
|
||||
, v8::Local<v8::Value> value
|
||||
, const v8::PropertyCallbackInfo<void> &info) {
|
||||
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
|
||||
PropertyCallbackInfo<void>
|
||||
cbinfo(info, obj->GetInternalField(kDataIndex));
|
||||
SetterCallback callback = reinterpret_cast<SetterCallback>(
|
||||
reinterpret_cast<intptr_t>(
|
||||
obj->GetInternalField(kSetterIndex).As<v8::External>()->Value()));
|
||||
callback(property.As<v8::String>(), value, cbinfo);
|
||||
}
|
||||
|
||||
typedef void (*NativeSetter)(
|
||||
v8::Local<v8::Name>
|
||||
, v8::Local<v8::Value>
|
||||
, const v8::PropertyCallbackInfo<void> &);
|
||||
#else
|
||||
static
|
||||
void GetterCallbackWrapper(
|
||||
v8::Local<v8::String> property
|
||||
, const v8::PropertyCallbackInfo<v8::Value> &info) {
|
||||
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
|
||||
PropertyCallbackInfo<v8::Value>
|
||||
cbinfo(info, obj->GetInternalField(kDataIndex));
|
||||
GetterCallback callback = reinterpret_cast<GetterCallback>(
|
||||
reinterpret_cast<intptr_t>(
|
||||
obj->GetInternalField(kGetterIndex).As<v8::External>()->Value()));
|
||||
callback(property, cbinfo);
|
||||
}
|
||||
|
||||
typedef void (*NativeGetter)
|
||||
(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value> &);
|
||||
|
||||
static
|
||||
void SetterCallbackWrapper(
|
||||
v8::Local<v8::String> property
|
||||
, v8::Local<v8::Value> value
|
||||
, const v8::PropertyCallbackInfo<void> &info) {
|
||||
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
|
||||
PropertyCallbackInfo<void>
|
||||
cbinfo(info, obj->GetInternalField(kDataIndex));
|
||||
SetterCallback callback = reinterpret_cast<SetterCallback>(
|
||||
reinterpret_cast<intptr_t>(
|
||||
obj->GetInternalField(kSetterIndex).As<v8::External>()->Value()));
|
||||
callback(property, value, cbinfo);
|
||||
}
|
||||
|
||||
typedef void (*NativeSetter)(
|
||||
v8::Local<v8::String>
|
||||
, v8::Local<v8::Value>
|
||||
, const v8::PropertyCallbackInfo<void> &);
|
||||
#endif
|
||||
|
||||
#if NODE_MODULE_VERSION > NODE_0_12_MODULE_VERSION
|
||||
static
|
||||
void PropertyGetterCallbackWrapper(
|
||||
v8::Local<v8::Name> property
|
||||
, const v8::PropertyCallbackInfo<v8::Value> &info) {
|
||||
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
|
||||
PropertyCallbackInfo<v8::Value>
|
||||
cbinfo(info, obj->GetInternalField(kDataIndex));
|
||||
PropertyGetterCallback callback = reinterpret_cast<PropertyGetterCallback>(
|
||||
reinterpret_cast<intptr_t>(
|
||||
obj->GetInternalField(kPropertyGetterIndex)
|
||||
.As<v8::External>()->Value()));
|
||||
callback(property.As<v8::String>(), cbinfo);
|
||||
}
|
||||
|
||||
typedef void (*NativePropertyGetter)
|
||||
(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value> &);
|
||||
|
||||
static
|
||||
void PropertySetterCallbackWrapper(
|
||||
v8::Local<v8::Name> property
|
||||
, v8::Local<v8::Value> value
|
||||
, const v8::PropertyCallbackInfo<v8::Value> &info) {
|
||||
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
|
||||
PropertyCallbackInfo<v8::Value>
|
||||
cbinfo(info, obj->GetInternalField(kDataIndex));
|
||||
PropertySetterCallback callback = reinterpret_cast<PropertySetterCallback>(
|
||||
reinterpret_cast<intptr_t>(
|
||||
obj->GetInternalField(kPropertySetterIndex)
|
||||
.As<v8::External>()->Value()));
|
||||
callback(property.As<v8::String>(), value, cbinfo);
|
||||
}
|
||||
|
||||
typedef void (*NativePropertySetter)(
|
||||
v8::Local<v8::Name>
|
||||
, v8::Local<v8::Value>
|
||||
, const v8::PropertyCallbackInfo<v8::Value> &);
|
||||
|
||||
static
|
||||
void PropertyEnumeratorCallbackWrapper(
|
||||
const v8::PropertyCallbackInfo<v8::Array> &info) {
|
||||
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
|
||||
PropertyCallbackInfo<v8::Array>
|
||||
cbinfo(info, obj->GetInternalField(kDataIndex));
|
||||
PropertyEnumeratorCallback callback =
|
||||
reinterpret_cast<PropertyEnumeratorCallback>(reinterpret_cast<intptr_t>(
|
||||
obj->GetInternalField(kPropertyEnumeratorIndex)
|
||||
.As<v8::External>()->Value()));
|
||||
callback(cbinfo);
|
||||
}
|
||||
|
||||
typedef void (*NativePropertyEnumerator)
|
||||
(const v8::PropertyCallbackInfo<v8::Array> &);
|
||||
|
||||
static
|
||||
void PropertyDeleterCallbackWrapper(
|
||||
v8::Local<v8::Name> property
|
||||
, const v8::PropertyCallbackInfo<v8::Boolean> &info) {
|
||||
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
|
||||
PropertyCallbackInfo<v8::Boolean>
|
||||
cbinfo(info, obj->GetInternalField(kDataIndex));
|
||||
PropertyDeleterCallback callback = reinterpret_cast<PropertyDeleterCallback>(
|
||||
reinterpret_cast<intptr_t>(
|
||||
obj->GetInternalField(kPropertyDeleterIndex)
|
||||
.As<v8::External>()->Value()));
|
||||
callback(property.As<v8::String>(), cbinfo);
|
||||
}
|
||||
|
||||
typedef void (NativePropertyDeleter)
|
||||
(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Boolean> &);
|
||||
|
||||
static
|
||||
void PropertyQueryCallbackWrapper(
|
||||
v8::Local<v8::Name> property
|
||||
, const v8::PropertyCallbackInfo<v8::Integer> &info) {
|
||||
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
|
||||
PropertyCallbackInfo<v8::Integer>
|
||||
cbinfo(info, obj->GetInternalField(kDataIndex));
|
||||
PropertyQueryCallback callback = reinterpret_cast<PropertyQueryCallback>(
|
||||
reinterpret_cast<intptr_t>(
|
||||
obj->GetInternalField(kPropertyQueryIndex)
|
||||
.As<v8::External>()->Value()));
|
||||
callback(property.As<v8::String>(), cbinfo);
|
||||
}
|
||||
|
||||
typedef void (*NativePropertyQuery)
|
||||
(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Integer> &);
|
||||
#else
|
||||
static
|
||||
void PropertyGetterCallbackWrapper(
|
||||
v8::Local<v8::String> property
|
||||
, const v8::PropertyCallbackInfo<v8::Value> &info) {
|
||||
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
|
||||
PropertyCallbackInfo<v8::Value>
|
||||
cbinfo(info, obj->GetInternalField(kDataIndex));
|
||||
PropertyGetterCallback callback = reinterpret_cast<PropertyGetterCallback>(
|
||||
reinterpret_cast<intptr_t>(
|
||||
obj->GetInternalField(kPropertyGetterIndex)
|
||||
.As<v8::External>()->Value()));
|
||||
callback(property, cbinfo);
|
||||
}
|
||||
|
||||
typedef void (*NativePropertyGetter)
|
||||
(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value> &);
|
||||
|
||||
static
|
||||
void PropertySetterCallbackWrapper(
|
||||
v8::Local<v8::String> property
|
||||
, v8::Local<v8::Value> value
|
||||
, const v8::PropertyCallbackInfo<v8::Value> &info) {
|
||||
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
|
||||
PropertyCallbackInfo<v8::Value>
|
||||
cbinfo(info, obj->GetInternalField(kDataIndex));
|
||||
PropertySetterCallback callback = reinterpret_cast<PropertySetterCallback>(
|
||||
reinterpret_cast<intptr_t>(
|
||||
obj->GetInternalField(kPropertySetterIndex)
|
||||
.As<v8::External>()->Value()));
|
||||
callback(property, value, cbinfo);
|
||||
}
|
||||
|
||||
typedef void (*NativePropertySetter)(
|
||||
v8::Local<v8::String>
|
||||
, v8::Local<v8::Value>
|
||||
, const v8::PropertyCallbackInfo<v8::Value> &);
|
||||
|
||||
static
|
||||
void PropertyEnumeratorCallbackWrapper(
|
||||
const v8::PropertyCallbackInfo<v8::Array> &info) {
|
||||
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
|
||||
PropertyCallbackInfo<v8::Array>
|
||||
cbinfo(info, obj->GetInternalField(kDataIndex));
|
||||
PropertyEnumeratorCallback callback =
|
||||
reinterpret_cast<PropertyEnumeratorCallback>(reinterpret_cast<intptr_t>(
|
||||
obj->GetInternalField(kPropertyEnumeratorIndex)
|
||||
.As<v8::External>()->Value()));
|
||||
callback(cbinfo);
|
||||
}
|
||||
|
||||
typedef void (*NativePropertyEnumerator)
|
||||
(const v8::PropertyCallbackInfo<v8::Array> &);
|
||||
|
||||
static
|
||||
void PropertyDeleterCallbackWrapper(
|
||||
v8::Local<v8::String> property
|
||||
, const v8::PropertyCallbackInfo<v8::Boolean> &info) {
|
||||
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
|
||||
PropertyCallbackInfo<v8::Boolean>
|
||||
cbinfo(info, obj->GetInternalField(kDataIndex));
|
||||
PropertyDeleterCallback callback = reinterpret_cast<PropertyDeleterCallback>(
|
||||
reinterpret_cast<intptr_t>(
|
||||
obj->GetInternalField(kPropertyDeleterIndex)
|
||||
.As<v8::External>()->Value()));
|
||||
callback(property, cbinfo);
|
||||
}
|
||||
|
||||
typedef void (NativePropertyDeleter)
|
||||
(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Boolean> &);
|
||||
|
||||
static
|
||||
void PropertyQueryCallbackWrapper(
|
||||
v8::Local<v8::String> property
|
||||
, const v8::PropertyCallbackInfo<v8::Integer> &info) {
|
||||
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
|
||||
PropertyCallbackInfo<v8::Integer>
|
||||
cbinfo(info, obj->GetInternalField(kDataIndex));
|
||||
PropertyQueryCallback callback = reinterpret_cast<PropertyQueryCallback>(
|
||||
reinterpret_cast<intptr_t>(
|
||||
obj->GetInternalField(kPropertyQueryIndex)
|
||||
.As<v8::External>()->Value()));
|
||||
callback(property, cbinfo);
|
||||
}
|
||||
|
||||
typedef void (*NativePropertyQuery)
|
||||
(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Integer> &);
|
||||
#endif
|
||||
|
||||
static
|
||||
void IndexGetterCallbackWrapper(
|
||||
uint32_t index, const v8::PropertyCallbackInfo<v8::Value> &info) {
|
||||
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
|
||||
PropertyCallbackInfo<v8::Value>
|
||||
cbinfo(info, obj->GetInternalField(kDataIndex));
|
||||
IndexGetterCallback callback = reinterpret_cast<IndexGetterCallback>(
|
||||
reinterpret_cast<intptr_t>(
|
||||
obj->GetInternalField(kIndexPropertyGetterIndex)
|
||||
.As<v8::External>()->Value()));
|
||||
callback(index, cbinfo);
|
||||
}
|
||||
|
||||
typedef void (*NativeIndexGetter)
|
||||
(uint32_t, const v8::PropertyCallbackInfo<v8::Value> &);
|
||||
|
||||
static
|
||||
void IndexSetterCallbackWrapper(
|
||||
uint32_t index
|
||||
, v8::Local<v8::Value> value
|
||||
, const v8::PropertyCallbackInfo<v8::Value> &info) {
|
||||
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
|
||||
PropertyCallbackInfo<v8::Value>
|
||||
cbinfo(info, obj->GetInternalField(kDataIndex));
|
||||
IndexSetterCallback callback = reinterpret_cast<IndexSetterCallback>(
|
||||
reinterpret_cast<intptr_t>(
|
||||
obj->GetInternalField(kIndexPropertySetterIndex)
|
||||
.As<v8::External>()->Value()));
|
||||
callback(index, value, cbinfo);
|
||||
}
|
||||
|
||||
typedef void (*NativeIndexSetter)(
|
||||
uint32_t
|
||||
, v8::Local<v8::Value>
|
||||
, const v8::PropertyCallbackInfo<v8::Value> &);
|
||||
|
||||
static
|
||||
void IndexEnumeratorCallbackWrapper(
|
||||
const v8::PropertyCallbackInfo<v8::Array> &info) {
|
||||
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
|
||||
PropertyCallbackInfo<v8::Array>
|
||||
cbinfo(info, obj->GetInternalField(kDataIndex));
|
||||
IndexEnumeratorCallback callback = reinterpret_cast<IndexEnumeratorCallback>(
|
||||
reinterpret_cast<intptr_t>(
|
||||
obj->GetInternalField(
|
||||
kIndexPropertyEnumeratorIndex).As<v8::External>()->Value()));
|
||||
callback(cbinfo);
|
||||
}
|
||||
|
||||
typedef void (*NativeIndexEnumerator)
|
||||
(const v8::PropertyCallbackInfo<v8::Array> &);
|
||||
|
||||
static
|
||||
void IndexDeleterCallbackWrapper(
|
||||
uint32_t index, const v8::PropertyCallbackInfo<v8::Boolean> &info) {
|
||||
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
|
||||
PropertyCallbackInfo<v8::Boolean>
|
||||
cbinfo(info, obj->GetInternalField(kDataIndex));
|
||||
IndexDeleterCallback callback = reinterpret_cast<IndexDeleterCallback>(
|
||||
reinterpret_cast<intptr_t>(
|
||||
obj->GetInternalField(kIndexPropertyDeleterIndex)
|
||||
.As<v8::External>()->Value()));
|
||||
callback(index, cbinfo);
|
||||
}
|
||||
|
||||
typedef void (*NativeIndexDeleter)
|
||||
(uint32_t, const v8::PropertyCallbackInfo<v8::Boolean> &);
|
||||
|
||||
static
|
||||
void IndexQueryCallbackWrapper(
|
||||
uint32_t index, const v8::PropertyCallbackInfo<v8::Integer> &info) {
|
||||
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
|
||||
PropertyCallbackInfo<v8::Integer>
|
||||
cbinfo(info, obj->GetInternalField(kDataIndex));
|
||||
IndexQueryCallback callback = reinterpret_cast<IndexQueryCallback>(
|
||||
reinterpret_cast<intptr_t>(
|
||||
obj->GetInternalField(kIndexPropertyQueryIndex)
|
||||
.As<v8::External>()->Value()));
|
||||
callback(index, cbinfo);
|
||||
}
|
||||
|
||||
typedef void (*NativeIndexQuery)
|
||||
(uint32_t, const v8::PropertyCallbackInfo<v8::Integer> &);
|
||||
} // end of namespace imp
|
||||
|
||||
#endif // NAN_CALLBACKS_12_INL_H_
|
||||
506
node_modules/sqlite3/node_modules/nan/nan_callbacks_pre_12_inl.h
generated
vendored
Normal file
506
node_modules/sqlite3/node_modules/nan/nan_callbacks_pre_12_inl.h
generated
vendored
Normal file
@@ -0,0 +1,506 @@
|
||||
/*********************************************************************
|
||||
* NAN - Native Abstractions for Node.js
|
||||
*
|
||||
* Copyright (c) 2015 NAN contributors
|
||||
*
|
||||
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
|
||||
********************************************************************/
|
||||
|
||||
#ifndef NAN_CALLBACKS_PRE_12_INL_H_
|
||||
#define NAN_CALLBACKS_PRE_12_INL_H_
|
||||
|
||||
namespace imp {
|
||||
template<typename T> class ReturnValueImp;
|
||||
} // end of namespace imp
|
||||
|
||||
template<typename T>
|
||||
class ReturnValue {
|
||||
v8::Isolate *isolate_;
|
||||
v8::Persistent<T> *value_;
|
||||
friend class imp::ReturnValueImp<T>;
|
||||
|
||||
public:
|
||||
template <class S>
|
||||
explicit inline ReturnValue(v8::Isolate *isolate, v8::Persistent<S> *p) :
|
||||
isolate_(isolate), value_(p) {}
|
||||
template <class S>
|
||||
explicit inline ReturnValue(const ReturnValue<S>& that)
|
||||
: isolate_(that.isolate_), value_(that.value_) {
|
||||
TYPE_CHECK(T, S);
|
||||
}
|
||||
|
||||
// Handle setters
|
||||
template <typename S> inline void Set(const v8::Local<S> &handle) {
|
||||
TYPE_CHECK(T, S);
|
||||
value_->Dispose();
|
||||
*value_ = v8::Persistent<T>::New(handle);
|
||||
}
|
||||
|
||||
template <typename S> inline void Set(const Global<S> &handle) {
|
||||
TYPE_CHECK(T, S);
|
||||
value_->Dispose();
|
||||
*value_ = v8::Persistent<T>::New(handle.persistent);
|
||||
const_cast<Global<S> &>(handle).Reset();
|
||||
}
|
||||
|
||||
// Fast primitive setters
|
||||
inline void Set(bool value) {
|
||||
TYPE_CHECK(T, v8::Boolean);
|
||||
value_->Dispose();
|
||||
*value_ = v8::Persistent<T>::New(v8::Boolean::New(value));
|
||||
}
|
||||
|
||||
inline void Set(double i) {
|
||||
TYPE_CHECK(T, v8::Number);
|
||||
value_->Dispose();
|
||||
*value_ = v8::Persistent<T>::New(v8::Number::New(i));
|
||||
}
|
||||
|
||||
inline void Set(int32_t i) {
|
||||
TYPE_CHECK(T, v8::Integer);
|
||||
value_->Dispose();
|
||||
*value_ = v8::Persistent<T>::New(v8::Int32::New(i));
|
||||
}
|
||||
|
||||
inline void Set(uint32_t i) {
|
||||
TYPE_CHECK(T, v8::Integer);
|
||||
value_->Dispose();
|
||||
*value_ = v8::Persistent<T>::New(v8::Uint32::New(i));
|
||||
}
|
||||
|
||||
// Fast JS primitive setters
|
||||
inline void SetNull() {
|
||||
TYPE_CHECK(T, v8::Primitive);
|
||||
value_->Dispose();
|
||||
*value_ = v8::Persistent<T>::New(v8::Null());
|
||||
}
|
||||
|
||||
inline void SetUndefined() {
|
||||
TYPE_CHECK(T, v8::Primitive);
|
||||
value_->Dispose();
|
||||
*value_ = v8::Persistent<T>::New(v8::Undefined());
|
||||
}
|
||||
|
||||
inline void SetEmptyString() {
|
||||
TYPE_CHECK(T, v8::String);
|
||||
value_->Dispose();
|
||||
*value_ = v8::Persistent<T>::New(v8::String::Empty());
|
||||
}
|
||||
|
||||
// Convenience getter for isolate
|
||||
inline v8::Isolate *GetIsolate() const {
|
||||
return isolate_;
|
||||
}
|
||||
|
||||
// Pointer setter: Uncompilable to prevent inadvertent misuse.
|
||||
template<typename S>
|
||||
inline void Set(S *whatever) { TYPE_CHECK(S*, v8::Primitive); }
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
class FunctionCallbackInfo {
|
||||
const v8::Arguments &args_;
|
||||
v8::Local<v8::Value> data_;
|
||||
ReturnValue<T> return_value_;
|
||||
v8::Persistent<T> retval_;
|
||||
|
||||
public:
|
||||
explicit inline FunctionCallbackInfo(
|
||||
const v8::Arguments &args
|
||||
, v8::Local<v8::Value> data) :
|
||||
args_(args)
|
||||
, data_(data)
|
||||
, return_value_(args.GetIsolate(), &retval_)
|
||||
, retval_(v8::Persistent<T>::New(v8::Undefined())) {}
|
||||
|
||||
inline ~FunctionCallbackInfo() {
|
||||
retval_.Dispose();
|
||||
retval_.Clear();
|
||||
}
|
||||
|
||||
inline ReturnValue<T> GetReturnValue() const {
|
||||
return ReturnValue<T>(return_value_);
|
||||
}
|
||||
|
||||
inline v8::Local<v8::Function> Callee() const { return args_.Callee(); }
|
||||
inline v8::Local<v8::Value> Data() const { return data_; }
|
||||
inline v8::Local<v8::Object> Holder() const { return args_.Holder(); }
|
||||
inline bool IsConstructCall() const { return args_.IsConstructCall(); }
|
||||
inline int Length() const { return args_.Length(); }
|
||||
inline v8::Local<v8::Value> operator[](int i) const { return args_[i]; }
|
||||
inline v8::Local<v8::Object> This() const { return args_.This(); }
|
||||
inline v8::Isolate *GetIsolate() const { return args_.GetIsolate(); }
|
||||
|
||||
|
||||
protected:
|
||||
static const int kHolderIndex = 0;
|
||||
static const int kIsolateIndex = 1;
|
||||
static const int kReturnValueDefaultValueIndex = 2;
|
||||
static const int kReturnValueIndex = 3;
|
||||
static const int kDataIndex = 4;
|
||||
static const int kCalleeIndex = 5;
|
||||
static const int kContextSaveIndex = 6;
|
||||
static const int kArgsLength = 7;
|
||||
|
||||
private:
|
||||
NAN_DISALLOW_ASSIGN_COPY_MOVE(FunctionCallbackInfo)
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
class PropertyCallbackInfoBase {
|
||||
const v8::AccessorInfo &info_;
|
||||
const v8::Local<v8::Value> &data_;
|
||||
|
||||
public:
|
||||
explicit inline PropertyCallbackInfoBase(
|
||||
const v8::AccessorInfo &info
|
||||
, const v8::Local<v8::Value> &data) :
|
||||
info_(info)
|
||||
, data_(data) {}
|
||||
|
||||
inline v8::Isolate* GetIsolate() const { return info_.GetIsolate(); }
|
||||
inline v8::Local<v8::Value> Data() const { return data_; }
|
||||
inline v8::Local<v8::Object> This() const { return info_.This(); }
|
||||
inline v8::Local<v8::Object> Holder() const { return info_.Holder(); }
|
||||
|
||||
protected:
|
||||
static const int kHolderIndex = 0;
|
||||
static const int kIsolateIndex = 1;
|
||||
static const int kReturnValueDefaultValueIndex = 2;
|
||||
static const int kReturnValueIndex = 3;
|
||||
static const int kDataIndex = 4;
|
||||
static const int kThisIndex = 5;
|
||||
static const int kArgsLength = 6;
|
||||
|
||||
private:
|
||||
NAN_DISALLOW_ASSIGN_COPY_MOVE(PropertyCallbackInfoBase)
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
class PropertyCallbackInfo : public PropertyCallbackInfoBase<T> {
|
||||
ReturnValue<T> return_value_;
|
||||
v8::Persistent<T> retval_;
|
||||
|
||||
public:
|
||||
explicit inline PropertyCallbackInfo(
|
||||
const v8::AccessorInfo &info
|
||||
, const v8::Local<v8::Value> &data) :
|
||||
PropertyCallbackInfoBase<T>(info, data)
|
||||
, return_value_(info.GetIsolate(), &retval_)
|
||||
, retval_(v8::Persistent<T>::New(v8::Undefined())) {}
|
||||
|
||||
inline ~PropertyCallbackInfo() {
|
||||
retval_.Dispose();
|
||||
retval_.Clear();
|
||||
}
|
||||
|
||||
inline ReturnValue<T> GetReturnValue() const { return return_value_; }
|
||||
};
|
||||
|
||||
template<>
|
||||
class PropertyCallbackInfo<v8::Array> :
|
||||
public PropertyCallbackInfoBase<v8::Array> {
|
||||
ReturnValue<v8::Array> return_value_;
|
||||
v8::Persistent<v8::Array> retval_;
|
||||
|
||||
public:
|
||||
explicit inline PropertyCallbackInfo(
|
||||
const v8::AccessorInfo &info
|
||||
, const v8::Local<v8::Value> &data) :
|
||||
PropertyCallbackInfoBase<v8::Array>(info, data)
|
||||
, return_value_(info.GetIsolate(), &retval_)
|
||||
, retval_(v8::Persistent<v8::Array>::New(v8::Local<v8::Array>())) {}
|
||||
|
||||
inline ~PropertyCallbackInfo() {
|
||||
retval_.Dispose();
|
||||
retval_.Clear();
|
||||
}
|
||||
|
||||
inline ReturnValue<v8::Array> GetReturnValue() const {
|
||||
return return_value_;
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
class PropertyCallbackInfo<v8::Boolean> :
|
||||
public PropertyCallbackInfoBase<v8::Boolean> {
|
||||
ReturnValue<v8::Boolean> return_value_;
|
||||
v8::Persistent<v8::Boolean> retval_;
|
||||
|
||||
public:
|
||||
explicit inline PropertyCallbackInfo(
|
||||
const v8::AccessorInfo &info
|
||||
, const v8::Local<v8::Value> &data) :
|
||||
PropertyCallbackInfoBase<v8::Boolean>(info, data)
|
||||
, return_value_(info.GetIsolate(), &retval_)
|
||||
, retval_(v8::Persistent<v8::Boolean>::New(v8::Local<v8::Boolean>())) {}
|
||||
|
||||
inline ~PropertyCallbackInfo() {
|
||||
retval_.Dispose();
|
||||
retval_.Clear();
|
||||
}
|
||||
|
||||
inline ReturnValue<v8::Boolean> GetReturnValue() const {
|
||||
return return_value_;
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
class PropertyCallbackInfo<v8::Integer> :
|
||||
public PropertyCallbackInfoBase<v8::Integer> {
|
||||
ReturnValue<v8::Integer> return_value_;
|
||||
v8::Persistent<v8::Integer> retval_;
|
||||
|
||||
public:
|
||||
explicit inline PropertyCallbackInfo(
|
||||
const v8::AccessorInfo &info
|
||||
, const v8::Local<v8::Value> &data) :
|
||||
PropertyCallbackInfoBase<v8::Integer>(info, data)
|
||||
, return_value_(info.GetIsolate(), &retval_)
|
||||
, retval_(v8::Persistent<v8::Integer>::New(v8::Local<v8::Integer>())) {}
|
||||
|
||||
inline ~PropertyCallbackInfo() {
|
||||
retval_.Dispose();
|
||||
retval_.Clear();
|
||||
}
|
||||
|
||||
inline ReturnValue<v8::Integer> GetReturnValue() const {
|
||||
return return_value_;
|
||||
}
|
||||
};
|
||||
|
||||
namespace imp {
|
||||
template<typename T>
|
||||
class ReturnValueImp : public ReturnValue<T> {
|
||||
public:
|
||||
explicit ReturnValueImp(ReturnValue<T> that) :
|
||||
ReturnValue<T>(that) {}
|
||||
NAN_INLINE v8::Handle<T> Value() {
|
||||
return *ReturnValue<T>::value_;
|
||||
}
|
||||
};
|
||||
|
||||
static
|
||||
v8::Handle<v8::Value> FunctionCallbackWrapper(const v8::Arguments &args) {
|
||||
v8::Local<v8::Object> obj = args.Data().As<v8::Object>();
|
||||
FunctionCallback callback = reinterpret_cast<FunctionCallback>(
|
||||
reinterpret_cast<intptr_t>(
|
||||
obj->GetInternalField(kFunctionIndex).As<v8::External>()->Value()));
|
||||
FunctionCallbackInfo<v8::Value>
|
||||
cbinfo(args, obj->GetInternalField(kDataIndex));
|
||||
callback(cbinfo);
|
||||
return ReturnValueImp<v8::Value>(cbinfo.GetReturnValue()).Value();
|
||||
}
|
||||
|
||||
typedef v8::Handle<v8::Value> (*NativeFunction)(const v8::Arguments &);
|
||||
|
||||
static
|
||||
v8::Handle<v8::Value> GetterCallbackWrapper(
|
||||
v8::Local<v8::String> property, const v8::AccessorInfo &info) {
|
||||
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
|
||||
PropertyCallbackInfo<v8::Value>
|
||||
cbinfo(info, obj->GetInternalField(kDataIndex));
|
||||
GetterCallback callback = reinterpret_cast<GetterCallback>(
|
||||
reinterpret_cast<intptr_t>(
|
||||
obj->GetInternalField(kGetterIndex).As<v8::External>()->Value()));
|
||||
callback(property, cbinfo);
|
||||
return ReturnValueImp<v8::Value>(cbinfo.GetReturnValue()).Value();
|
||||
}
|
||||
|
||||
typedef v8::Handle<v8::Value> (*NativeGetter)
|
||||
(v8::Local<v8::String>, const v8::AccessorInfo &);
|
||||
|
||||
static
|
||||
void SetterCallbackWrapper(
|
||||
v8::Local<v8::String> property
|
||||
, v8::Local<v8::Value> value
|
||||
, const v8::AccessorInfo &info) {
|
||||
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
|
||||
PropertyCallbackInfo<void>
|
||||
cbinfo(info, obj->GetInternalField(kDataIndex));
|
||||
SetterCallback callback = reinterpret_cast<SetterCallback>(
|
||||
reinterpret_cast<intptr_t>(
|
||||
obj->GetInternalField(kSetterIndex).As<v8::External>()->Value()));
|
||||
callback(property, value, cbinfo);
|
||||
}
|
||||
|
||||
typedef void (*NativeSetter)
|
||||
(v8::Local<v8::String>, v8::Local<v8::Value>, const v8::AccessorInfo &);
|
||||
|
||||
static
|
||||
v8::Handle<v8::Value> PropertyGetterCallbackWrapper(
|
||||
v8::Local<v8::String> property, const v8::AccessorInfo &info) {
|
||||
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
|
||||
PropertyCallbackInfo<v8::Value>
|
||||
cbinfo(info, obj->GetInternalField(kDataIndex));
|
||||
PropertyGetterCallback callback = reinterpret_cast<PropertyGetterCallback>(
|
||||
reinterpret_cast<intptr_t>(
|
||||
obj->GetInternalField(kPropertyGetterIndex)
|
||||
.As<v8::External>()->Value()));
|
||||
callback(property, cbinfo);
|
||||
return ReturnValueImp<v8::Value>(cbinfo.GetReturnValue()).Value();
|
||||
}
|
||||
|
||||
typedef v8::Handle<v8::Value> (*NativePropertyGetter)
|
||||
(v8::Local<v8::String>, const v8::AccessorInfo &);
|
||||
|
||||
static
|
||||
v8::Handle<v8::Value> PropertySetterCallbackWrapper(
|
||||
v8::Local<v8::String> property
|
||||
, v8::Local<v8::Value> value
|
||||
, const v8::AccessorInfo &info) {
|
||||
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
|
||||
PropertyCallbackInfo<v8::Value>
|
||||
cbinfo(info, obj->GetInternalField(kDataIndex));
|
||||
PropertySetterCallback callback = reinterpret_cast<PropertySetterCallback>(
|
||||
reinterpret_cast<intptr_t>(
|
||||
obj->GetInternalField(kPropertySetterIndex)
|
||||
.As<v8::External>()->Value()));
|
||||
callback(property, value, cbinfo);
|
||||
return ReturnValueImp<v8::Value>(cbinfo.GetReturnValue()).Value();
|
||||
}
|
||||
|
||||
typedef v8::Handle<v8::Value> (*NativePropertySetter)
|
||||
(v8::Local<v8::String>, v8::Local<v8::Value>, const v8::AccessorInfo &);
|
||||
|
||||
static
|
||||
v8::Handle<v8::Array> PropertyEnumeratorCallbackWrapper(
|
||||
const v8::AccessorInfo &info) {
|
||||
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
|
||||
PropertyCallbackInfo<v8::Array>
|
||||
cbinfo(info, obj->GetInternalField(kDataIndex));
|
||||
PropertyEnumeratorCallback callback =
|
||||
reinterpret_cast<PropertyEnumeratorCallback>(reinterpret_cast<intptr_t>(
|
||||
obj->GetInternalField(kPropertyEnumeratorIndex)
|
||||
.As<v8::External>()->Value()));
|
||||
callback(cbinfo);
|
||||
return ReturnValueImp<v8::Array>(cbinfo.GetReturnValue()).Value();
|
||||
}
|
||||
|
||||
typedef v8::Handle<v8::Array> (*NativePropertyEnumerator)
|
||||
(const v8::AccessorInfo &);
|
||||
|
||||
static
|
||||
v8::Handle<v8::Boolean> PropertyDeleterCallbackWrapper(
|
||||
v8::Local<v8::String> property
|
||||
, const v8::AccessorInfo &info) {
|
||||
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
|
||||
PropertyCallbackInfo<v8::Boolean>
|
||||
cbinfo(info, obj->GetInternalField(kDataIndex));
|
||||
PropertyDeleterCallback callback = reinterpret_cast<PropertyDeleterCallback>(
|
||||
reinterpret_cast<intptr_t>(
|
||||
obj->GetInternalField(kPropertyDeleterIndex)
|
||||
.As<v8::External>()->Value()));
|
||||
callback(property, cbinfo);
|
||||
return ReturnValueImp<v8::Boolean>(cbinfo.GetReturnValue()).Value();
|
||||
}
|
||||
|
||||
typedef v8::Handle<v8::Boolean> (NativePropertyDeleter)
|
||||
(v8::Local<v8::String>, const v8::AccessorInfo &);
|
||||
|
||||
static
|
||||
v8::Handle<v8::Integer> PropertyQueryCallbackWrapper(
|
||||
v8::Local<v8::String> property, const v8::AccessorInfo &info) {
|
||||
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
|
||||
PropertyCallbackInfo<v8::Integer>
|
||||
cbinfo(info, obj->GetInternalField(kDataIndex));
|
||||
PropertyQueryCallback callback = reinterpret_cast<PropertyQueryCallback>(
|
||||
reinterpret_cast<intptr_t>(
|
||||
obj->GetInternalField(kPropertyQueryIndex)
|
||||
.As<v8::External>()->Value()));
|
||||
callback(property, cbinfo);
|
||||
return ReturnValueImp<v8::Integer>(cbinfo.GetReturnValue()).Value();
|
||||
}
|
||||
|
||||
typedef v8::Handle<v8::Integer> (*NativePropertyQuery)
|
||||
(v8::Local<v8::String>, const v8::AccessorInfo &);
|
||||
|
||||
static
|
||||
v8::Handle<v8::Value> IndexGetterCallbackWrapper(
|
||||
uint32_t index, const v8::AccessorInfo &info) {
|
||||
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
|
||||
PropertyCallbackInfo<v8::Value>
|
||||
cbinfo(info, obj->GetInternalField(kDataIndex));
|
||||
IndexGetterCallback callback = reinterpret_cast<IndexGetterCallback>(
|
||||
reinterpret_cast<intptr_t>(
|
||||
obj->GetInternalField(kIndexPropertyGetterIndex)
|
||||
.As<v8::External>()->Value()));
|
||||
callback(index, cbinfo);
|
||||
return ReturnValueImp<v8::Value>(cbinfo.GetReturnValue()).Value();
|
||||
}
|
||||
|
||||
typedef v8::Handle<v8::Value> (*NativeIndexGetter)
|
||||
(uint32_t, const v8::AccessorInfo &);
|
||||
|
||||
static
|
||||
v8::Handle<v8::Value> IndexSetterCallbackWrapper(
|
||||
uint32_t index
|
||||
, v8::Local<v8::Value> value
|
||||
, const v8::AccessorInfo &info) {
|
||||
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
|
||||
PropertyCallbackInfo<v8::Value>
|
||||
cbinfo(info, obj->GetInternalField(kDataIndex));
|
||||
IndexSetterCallback callback = reinterpret_cast<IndexSetterCallback>(
|
||||
reinterpret_cast<intptr_t>(
|
||||
obj->GetInternalField(kIndexPropertySetterIndex)
|
||||
.As<v8::External>()->Value()));
|
||||
callback(index, value, cbinfo);
|
||||
return ReturnValueImp<v8::Value>(cbinfo.GetReturnValue()).Value();
|
||||
}
|
||||
|
||||
typedef v8::Handle<v8::Value> (*NativeIndexSetter)
|
||||
(uint32_t, v8::Local<v8::Value>, const v8::AccessorInfo &);
|
||||
|
||||
static
|
||||
v8::Handle<v8::Array> IndexEnumeratorCallbackWrapper(
|
||||
const v8::AccessorInfo &info) {
|
||||
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
|
||||
PropertyCallbackInfo<v8::Array>
|
||||
cbinfo(info, obj->GetInternalField(kDataIndex));
|
||||
IndexEnumeratorCallback callback = reinterpret_cast<IndexEnumeratorCallback>(
|
||||
reinterpret_cast<intptr_t>(
|
||||
obj->GetInternalField(kIndexPropertyEnumeratorIndex)
|
||||
.As<v8::External>()->Value()));
|
||||
callback(cbinfo);
|
||||
return ReturnValueImp<v8::Array>(cbinfo.GetReturnValue()).Value();
|
||||
}
|
||||
|
||||
typedef v8::Handle<v8::Array> (*NativeIndexEnumerator)
|
||||
(const v8::AccessorInfo &);
|
||||
|
||||
static
|
||||
v8::Handle<v8::Boolean> IndexDeleterCallbackWrapper(
|
||||
uint32_t index, const v8::AccessorInfo &info) {
|
||||
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
|
||||
PropertyCallbackInfo<v8::Boolean>
|
||||
cbinfo(info, obj->GetInternalField(kDataIndex));
|
||||
IndexDeleterCallback callback = reinterpret_cast<IndexDeleterCallback>(
|
||||
reinterpret_cast<intptr_t>(
|
||||
obj->GetInternalField(kIndexPropertyDeleterIndex)
|
||||
.As<v8::External>()->Value()));
|
||||
callback(index, cbinfo);
|
||||
return ReturnValueImp<v8::Boolean>(cbinfo.GetReturnValue()).Value();
|
||||
}
|
||||
|
||||
typedef v8::Handle<v8::Boolean> (*NativeIndexDeleter)
|
||||
(uint32_t, const v8::AccessorInfo &);
|
||||
|
||||
static
|
||||
v8::Handle<v8::Integer> IndexQueryCallbackWrapper(
|
||||
uint32_t index, const v8::AccessorInfo &info) {
|
||||
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
|
||||
PropertyCallbackInfo<v8::Integer>
|
||||
cbinfo(info, obj->GetInternalField(kDataIndex));
|
||||
IndexQueryCallback callback = reinterpret_cast<IndexQueryCallback>(
|
||||
reinterpret_cast<intptr_t>(
|
||||
obj->GetInternalField(kIndexPropertyQueryIndex)
|
||||
.As<v8::External>()->Value()));
|
||||
callback(index, cbinfo);
|
||||
return ReturnValueImp<v8::Integer>(cbinfo.GetReturnValue()).Value();
|
||||
}
|
||||
|
||||
typedef v8::Handle<v8::Integer> (*NativeIndexQuery)
|
||||
(uint32_t, const v8::AccessorInfo &);
|
||||
} // end of namespace imp
|
||||
|
||||
#endif // NAN_CALLBACKS_PRE_12_INL_H_
|
||||
64
node_modules/sqlite3/node_modules/nan/nan_converters.h
generated
vendored
Normal file
64
node_modules/sqlite3/node_modules/nan/nan_converters.h
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
/*********************************************************************
|
||||
* NAN - Native Abstractions for Node.js
|
||||
*
|
||||
* Copyright (c) 2015 NAN contributors
|
||||
*
|
||||
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
|
||||
********************************************************************/
|
||||
|
||||
#ifndef NAN_CONVERTERS_H_
|
||||
#define NAN_CONVERTERS_H_
|
||||
|
||||
namespace imp {
|
||||
template<typename T> struct ToFactoryBase {
|
||||
typedef MaybeLocal<T> return_t;
|
||||
};
|
||||
template<typename T> struct ValueFactoryBase { typedef Maybe<T> return_t; };
|
||||
|
||||
template<typename T> struct ToFactory;
|
||||
|
||||
#define X(TYPE) \
|
||||
template<> \
|
||||
struct ToFactory<v8::TYPE> : ToFactoryBase<v8::TYPE> { \
|
||||
static inline return_t convert(v8::Local<v8::Value> val); \
|
||||
};
|
||||
|
||||
X(Boolean)
|
||||
X(Number)
|
||||
X(String)
|
||||
X(Object)
|
||||
X(Integer)
|
||||
X(Uint32)
|
||||
X(Int32)
|
||||
|
||||
#undef X
|
||||
|
||||
#define X(TYPE) \
|
||||
template<> \
|
||||
struct ToFactory<TYPE> : ValueFactoryBase<TYPE> { \
|
||||
static inline return_t convert(v8::Local<v8::Value> val); \
|
||||
};
|
||||
|
||||
X(bool)
|
||||
X(double)
|
||||
X(int64_t)
|
||||
X(uint32_t)
|
||||
X(int32_t)
|
||||
|
||||
#undef X
|
||||
} // end of namespace imp
|
||||
|
||||
template<typename T>
|
||||
NAN_INLINE
|
||||
typename imp::ToFactory<T>::return_t To(v8::Local<v8::Value> val) {
|
||||
return imp::ToFactory<T>::convert(val);
|
||||
}
|
||||
|
||||
#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \
|
||||
(V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3))
|
||||
# include "nan_converters_43_inl.h"
|
||||
#else
|
||||
# include "nan_converters_pre_43_inl.h"
|
||||
#endif
|
||||
|
||||
#endif // NAN_CONVERTERS_H_
|
||||
42
node_modules/sqlite3/node_modules/nan/nan_converters_43_inl.h
generated
vendored
Normal file
42
node_modules/sqlite3/node_modules/nan/nan_converters_43_inl.h
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
/*********************************************************************
|
||||
* NAN - Native Abstractions for Node.js
|
||||
*
|
||||
* Copyright (c) 2015 NAN contributors
|
||||
*
|
||||
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
|
||||
********************************************************************/
|
||||
|
||||
#ifndef NAN_CONVERTERS_43_INL_H_
|
||||
#define NAN_CONVERTERS_43_INL_H_
|
||||
|
||||
#define X(TYPE) \
|
||||
imp::ToFactory<v8::TYPE>::return_t \
|
||||
imp::ToFactory<v8::TYPE>::convert(v8::Local<v8::Value> val) { \
|
||||
return val->To ## TYPE(GetCurrentContext()); \
|
||||
}
|
||||
|
||||
X(Boolean)
|
||||
X(Number)
|
||||
X(String)
|
||||
X(Object)
|
||||
X(Integer)
|
||||
X(Uint32)
|
||||
X(Int32)
|
||||
|
||||
#undef X
|
||||
|
||||
#define X(TYPE, NAME) \
|
||||
imp::ToFactory<TYPE>::return_t \
|
||||
imp::ToFactory<TYPE>::convert(v8::Local<v8::Value> val) { \
|
||||
return val->NAME ## Value(GetCurrentContext()); \
|
||||
}
|
||||
|
||||
X(bool, Boolean)
|
||||
X(double, Number)
|
||||
X(int64_t, Integer)
|
||||
X(uint32_t, Uint32)
|
||||
X(int32_t, Int32)
|
||||
|
||||
#undef X
|
||||
|
||||
#endif // NAN_CONVERTERS_43_INL_H_
|
||||
42
node_modules/sqlite3/node_modules/nan/nan_converters_pre_43_inl.h
generated
vendored
Normal file
42
node_modules/sqlite3/node_modules/nan/nan_converters_pre_43_inl.h
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
/*********************************************************************
|
||||
* NAN - Native Abstractions for Node.js
|
||||
*
|
||||
* Copyright (c) 2015 NAN contributors
|
||||
*
|
||||
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
|
||||
********************************************************************/
|
||||
|
||||
#ifndef NAN_CONVERTERS_PRE_43_INL_H_
|
||||
#define NAN_CONVERTERS_PRE_43_INL_H_
|
||||
|
||||
#define X(TYPE) \
|
||||
imp::ToFactory<v8::TYPE>::return_t \
|
||||
imp::ToFactory<v8::TYPE>::convert(v8::Local<v8::Value> val) { \
|
||||
return MaybeLocal<v8::TYPE>(val->To ## TYPE()); \
|
||||
}
|
||||
|
||||
X(Boolean)
|
||||
X(Number)
|
||||
X(String)
|
||||
X(Object)
|
||||
X(Integer)
|
||||
X(Uint32)
|
||||
X(Int32)
|
||||
|
||||
#undef X
|
||||
|
||||
#define X(TYPE, NAME) \
|
||||
imp::ToFactory<TYPE>::return_t \
|
||||
imp::ToFactory<TYPE>::convert(v8::Local<v8::Value> val) { \
|
||||
return Just<TYPE>(val->NAME ##Value()); \
|
||||
}
|
||||
|
||||
X(bool, Boolean)
|
||||
X(double, Number)
|
||||
X(int64_t, Integer)
|
||||
X(uint32_t, Uint32)
|
||||
X(int32_t, Int32)
|
||||
|
||||
#undef X
|
||||
|
||||
#endif // NAN_CONVERTERS_PRE_43_INL_H_
|
||||
399
node_modules/sqlite3/node_modules/nan/nan_implementation_12_inl.h
generated
vendored
Normal file
399
node_modules/sqlite3/node_modules/nan/nan_implementation_12_inl.h
generated
vendored
Normal file
@@ -0,0 +1,399 @@
|
||||
/*********************************************************************
|
||||
* NAN - Native Abstractions for Node.js
|
||||
*
|
||||
* Copyright (c) 2015 NAN contributors
|
||||
*
|
||||
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
|
||||
********************************************************************/
|
||||
|
||||
#ifndef NAN_IMPLEMENTATION_12_INL_H_
|
||||
#define NAN_IMPLEMENTATION_12_INL_H_
|
||||
//==============================================================================
|
||||
// node v0.11 implementation
|
||||
//==============================================================================
|
||||
|
||||
namespace imp {
|
||||
|
||||
//=== Array ====================================================================
|
||||
|
||||
Factory<v8::Array>::return_t
|
||||
Factory<v8::Array>::New() {
|
||||
return v8::Array::New(v8::Isolate::GetCurrent());
|
||||
}
|
||||
|
||||
Factory<v8::Array>::return_t
|
||||
Factory<v8::Array>::New(int length) {
|
||||
return v8::Array::New(v8::Isolate::GetCurrent(), length);
|
||||
}
|
||||
|
||||
//=== Boolean ==================================================================
|
||||
|
||||
Factory<v8::Boolean>::return_t
|
||||
Factory<v8::Boolean>::New(bool value) {
|
||||
return v8::Boolean::New(v8::Isolate::GetCurrent(), value);
|
||||
}
|
||||
|
||||
//=== Boolean Object ===========================================================
|
||||
|
||||
Factory<v8::BooleanObject>::return_t
|
||||
Factory<v8::BooleanObject>::New(bool value) {
|
||||
return v8::BooleanObject::New(value).As<v8::BooleanObject>();
|
||||
}
|
||||
|
||||
//=== Context ==================================================================
|
||||
|
||||
Factory<v8::Context>::return_t
|
||||
Factory<v8::Context>::New( v8::ExtensionConfiguration* extensions
|
||||
, v8::Local<v8::ObjectTemplate> tmpl
|
||||
, v8::Local<v8::Value> obj) {
|
||||
return v8::Context::New(v8::Isolate::GetCurrent(), extensions, tmpl, obj);
|
||||
}
|
||||
|
||||
//=== Date =====================================================================
|
||||
|
||||
#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \
|
||||
(V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3))
|
||||
Factory<v8::Date>::return_t
|
||||
Factory<v8::Date>::New(double value) {
|
||||
v8::Local<v8::Date> ret;
|
||||
if (v8::Date::New(GetCurrentContext(), value).
|
||||
ToLocal(reinterpret_cast<v8::Local<v8::Value>*>(&ret))) {
|
||||
return v8::MaybeLocal<v8::Date>(ret);
|
||||
} else {
|
||||
return v8::MaybeLocal<v8::Date>(ret);
|
||||
}
|
||||
}
|
||||
#else
|
||||
Factory<v8::Date>::return_t
|
||||
Factory<v8::Date>::New(double value) {
|
||||
return Factory<v8::Date>::return_t(
|
||||
v8::Date::New(v8::Isolate::GetCurrent(), value).As<v8::Date>());
|
||||
}
|
||||
#endif
|
||||
|
||||
//=== External =================================================================
|
||||
|
||||
Factory<v8::External>::return_t
|
||||
Factory<v8::External>::New(void * value) {
|
||||
return v8::External::New(v8::Isolate::GetCurrent(), value);
|
||||
}
|
||||
|
||||
//=== Function =================================================================
|
||||
|
||||
Factory<v8::Function>::return_t
|
||||
Factory<v8::Function>::New( FunctionCallback callback
|
||||
, v8::Local<v8::Value> data) {
|
||||
v8::Isolate *isolate = v8::Isolate::GetCurrent();
|
||||
v8::EscapableHandleScope scope(isolate);
|
||||
v8::Local<v8::ObjectTemplate> tpl = v8::ObjectTemplate::New(isolate);
|
||||
tpl->SetInternalFieldCount(imp::kFunctionFieldCount);
|
||||
v8::Local<v8::Object> obj = NewInstance(tpl).ToLocalChecked();
|
||||
|
||||
obj->SetInternalField(
|
||||
imp::kFunctionIndex
|
||||
, v8::External::New(isolate, reinterpret_cast<void *>(callback)));
|
||||
|
||||
v8::Local<v8::Value> val = v8::Local<v8::Value>::New(isolate, data);
|
||||
|
||||
if (!val.IsEmpty()) {
|
||||
obj->SetInternalField(imp::kDataIndex, val);
|
||||
}
|
||||
|
||||
return scope.Escape(v8::Function::New( isolate
|
||||
, imp::FunctionCallbackWrapper
|
||||
, obj));
|
||||
}
|
||||
|
||||
//=== Function Template ========================================================
|
||||
|
||||
Factory<v8::FunctionTemplate>::return_t
|
||||
Factory<v8::FunctionTemplate>::New( FunctionCallback callback
|
||||
, v8::Local<v8::Value> data
|
||||
, v8::Local<v8::Signature> signature) {
|
||||
v8::Isolate *isolate = v8::Isolate::GetCurrent();
|
||||
if (callback) {
|
||||
v8::EscapableHandleScope scope(isolate);
|
||||
v8::Local<v8::ObjectTemplate> tpl = v8::ObjectTemplate::New(isolate);
|
||||
tpl->SetInternalFieldCount(imp::kFunctionFieldCount);
|
||||
v8::Local<v8::Object> obj = NewInstance(tpl).ToLocalChecked();
|
||||
|
||||
obj->SetInternalField(
|
||||
imp::kFunctionIndex
|
||||
, v8::External::New(isolate, reinterpret_cast<void *>(callback)));
|
||||
v8::Local<v8::Value> val = v8::Local<v8::Value>::New(isolate, data);
|
||||
|
||||
if (!val.IsEmpty()) {
|
||||
obj->SetInternalField(imp::kDataIndex, val);
|
||||
}
|
||||
|
||||
return scope.Escape(v8::FunctionTemplate::New( isolate
|
||||
, imp::FunctionCallbackWrapper
|
||||
, obj
|
||||
, signature));
|
||||
} else {
|
||||
return v8::FunctionTemplate::New(isolate, 0, data, signature);
|
||||
}
|
||||
}
|
||||
|
||||
//=== Number ===================================================================
|
||||
|
||||
Factory<v8::Number>::return_t
|
||||
Factory<v8::Number>::New(double value) {
|
||||
return v8::Number::New(v8::Isolate::GetCurrent(), value);
|
||||
}
|
||||
|
||||
//=== Number Object ============================================================
|
||||
|
||||
Factory<v8::NumberObject>::return_t
|
||||
Factory<v8::NumberObject>::New(double value) {
|
||||
return v8::NumberObject::New( v8::Isolate::GetCurrent()
|
||||
, value).As<v8::NumberObject>();
|
||||
}
|
||||
|
||||
//=== Integer, Int32 and Uint32 ================================================
|
||||
|
||||
template <typename T>
|
||||
typename IntegerFactory<T>::return_t
|
||||
IntegerFactory<T>::New(int32_t value) {
|
||||
return To<T>(T::New(v8::Isolate::GetCurrent(), value));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
typename IntegerFactory<T>::return_t
|
||||
IntegerFactory<T>::New(uint32_t value) {
|
||||
return To<T>(T::NewFromUnsigned(v8::Isolate::GetCurrent(), value));
|
||||
}
|
||||
|
||||
Factory<v8::Uint32>::return_t
|
||||
Factory<v8::Uint32>::New(int32_t value) {
|
||||
return To<v8::Uint32>(
|
||||
v8::Uint32::NewFromUnsigned(v8::Isolate::GetCurrent(), value));
|
||||
}
|
||||
|
||||
Factory<v8::Uint32>::return_t
|
||||
Factory<v8::Uint32>::New(uint32_t value) {
|
||||
return To<v8::Uint32>(
|
||||
v8::Uint32::NewFromUnsigned(v8::Isolate::GetCurrent(), value));
|
||||
}
|
||||
|
||||
//=== Object ===================================================================
|
||||
|
||||
Factory<v8::Object>::return_t
|
||||
Factory<v8::Object>::New() {
|
||||
return v8::Object::New(v8::Isolate::GetCurrent());
|
||||
}
|
||||
|
||||
//=== Object Template ==========================================================
|
||||
|
||||
Factory<v8::ObjectTemplate>::return_t
|
||||
Factory<v8::ObjectTemplate>::New() {
|
||||
return v8::ObjectTemplate::New(v8::Isolate::GetCurrent());
|
||||
}
|
||||
|
||||
//=== RegExp ===================================================================
|
||||
|
||||
#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \
|
||||
(V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3))
|
||||
Factory<v8::RegExp>::return_t
|
||||
Factory<v8::RegExp>::New(
|
||||
v8::Local<v8::String> pattern
|
||||
, v8::RegExp::Flags flags) {
|
||||
return v8::RegExp::New(GetCurrentContext(), pattern, flags);
|
||||
}
|
||||
#else
|
||||
Factory<v8::RegExp>::return_t
|
||||
Factory<v8::RegExp>::New(
|
||||
v8::Local<v8::String> pattern
|
||||
, v8::RegExp::Flags flags) {
|
||||
return Factory<v8::RegExp>::return_t(v8::RegExp::New(pattern, flags));
|
||||
}
|
||||
#endif
|
||||
|
||||
//=== Script ===================================================================
|
||||
|
||||
#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \
|
||||
(V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3))
|
||||
Factory<v8::Script>::return_t
|
||||
Factory<v8::Script>::New( v8::Local<v8::String> source) {
|
||||
v8::ScriptCompiler::Source src(source);
|
||||
return v8::ScriptCompiler::Compile(GetCurrentContext(), &src);
|
||||
}
|
||||
|
||||
Factory<v8::Script>::return_t
|
||||
Factory<v8::Script>::New( v8::Local<v8::String> source
|
||||
, v8::ScriptOrigin const& origin) {
|
||||
v8::ScriptCompiler::Source src(source, origin);
|
||||
return v8::ScriptCompiler::Compile(GetCurrentContext(), &src);
|
||||
}
|
||||
#else
|
||||
Factory<v8::Script>::return_t
|
||||
Factory<v8::Script>::New( v8::Local<v8::String> source) {
|
||||
v8::ScriptCompiler::Source src(source);
|
||||
return Factory<v8::Script>::return_t(
|
||||
v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &src));
|
||||
}
|
||||
|
||||
Factory<v8::Script>::return_t
|
||||
Factory<v8::Script>::New( v8::Local<v8::String> source
|
||||
, v8::ScriptOrigin const& origin) {
|
||||
v8::ScriptCompiler::Source src(source, origin);
|
||||
return Factory<v8::Script>::return_t(
|
||||
v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &src));
|
||||
}
|
||||
#endif
|
||||
|
||||
//=== Signature ================================================================
|
||||
|
||||
Factory<v8::Signature>::return_t
|
||||
Factory<v8::Signature>::New(Factory<v8::Signature>::FTH receiver) {
|
||||
return v8::Signature::New(v8::Isolate::GetCurrent(), receiver);
|
||||
}
|
||||
|
||||
//=== String ===================================================================
|
||||
|
||||
Factory<v8::String>::return_t
|
||||
Factory<v8::String>::New() {
|
||||
return Factory<v8::String>::return_t(
|
||||
v8::String::Empty(v8::Isolate::GetCurrent()));
|
||||
}
|
||||
|
||||
#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \
|
||||
(V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3))
|
||||
Factory<v8::String>::return_t
|
||||
Factory<v8::String>::New(const char * value, int length) {
|
||||
return v8::String::NewFromUtf8(
|
||||
v8::Isolate::GetCurrent(), value, v8::NewStringType::kNormal, length);
|
||||
}
|
||||
|
||||
Factory<v8::String>::return_t
|
||||
Factory<v8::String>::New(std::string const& value) {
|
||||
assert(value.size() <= INT_MAX && "string too long");
|
||||
return v8::String::NewFromUtf8(v8::Isolate::GetCurrent(),
|
||||
value.data(), v8::NewStringType::kNormal, static_cast<int>(value.size()));
|
||||
}
|
||||
|
||||
Factory<v8::String>::return_t
|
||||
Factory<v8::String>::New(const uint16_t * value, int length) {
|
||||
return v8::String::NewFromTwoByte(v8::Isolate::GetCurrent(), value,
|
||||
v8::NewStringType::kNormal, length);
|
||||
}
|
||||
|
||||
Factory<v8::String>::return_t
|
||||
Factory<v8::String>::New(v8::String::ExternalStringResource * value) {
|
||||
return v8::String::NewExternalTwoByte(v8::Isolate::GetCurrent(), value);
|
||||
}
|
||||
|
||||
Factory<v8::String>::return_t
|
||||
Factory<v8::String>::New(ExternalOneByteStringResource * value) {
|
||||
return v8::String::NewExternalOneByte(v8::Isolate::GetCurrent(), value);
|
||||
}
|
||||
#else
|
||||
Factory<v8::String>::return_t
|
||||
Factory<v8::String>::New(const char * value, int length) {
|
||||
return Factory<v8::String>::return_t(
|
||||
v8::String::NewFromUtf8(
|
||||
v8::Isolate::GetCurrent()
|
||||
, value
|
||||
, v8::String::kNormalString
|
||||
, length));
|
||||
}
|
||||
|
||||
Factory<v8::String>::return_t
|
||||
Factory<v8::String>::New(
|
||||
std::string const& value) /* NOLINT(build/include_what_you_use) */ {
|
||||
assert(value.size() <= INT_MAX && "string too long");
|
||||
return Factory<v8::String>::return_t(
|
||||
v8::String::NewFromUtf8(
|
||||
v8::Isolate::GetCurrent()
|
||||
, value.data()
|
||||
, v8::String::kNormalString
|
||||
, static_cast<int>(value.size())));
|
||||
}
|
||||
|
||||
Factory<v8::String>::return_t
|
||||
Factory<v8::String>::New(const uint16_t * value, int length) {
|
||||
return Factory<v8::String>::return_t(
|
||||
v8::String::NewFromTwoByte(
|
||||
v8::Isolate::GetCurrent()
|
||||
, value
|
||||
, v8::String::kNormalString
|
||||
, length));
|
||||
}
|
||||
|
||||
Factory<v8::String>::return_t
|
||||
Factory<v8::String>::New(v8::String::ExternalStringResource * value) {
|
||||
return Factory<v8::String>::return_t(
|
||||
v8::String::NewExternal(v8::Isolate::GetCurrent(), value));
|
||||
}
|
||||
|
||||
Factory<v8::String>::return_t
|
||||
Factory<v8::String>::New(ExternalOneByteStringResource * value) {
|
||||
return Factory<v8::String>::return_t(
|
||||
v8::String::NewExternal(v8::Isolate::GetCurrent(), value));
|
||||
}
|
||||
#endif
|
||||
|
||||
//=== String Object ============================================================
|
||||
|
||||
Factory<v8::StringObject>::return_t
|
||||
Factory<v8::StringObject>::New(v8::Local<v8::String> value) {
|
||||
return v8::StringObject::New(value).As<v8::StringObject>();
|
||||
}
|
||||
|
||||
//=== Unbound Script ===========================================================
|
||||
|
||||
#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \
|
||||
(V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3))
|
||||
Factory<v8::UnboundScript>::return_t
|
||||
Factory<v8::UnboundScript>::New(v8::Local<v8::String> source) {
|
||||
v8::ScriptCompiler::Source src(source);
|
||||
return v8::ScriptCompiler::CompileUnboundScript(
|
||||
v8::Isolate::GetCurrent(), &src);
|
||||
}
|
||||
|
||||
Factory<v8::UnboundScript>::return_t
|
||||
Factory<v8::UnboundScript>::New( v8::Local<v8::String> source
|
||||
, v8::ScriptOrigin const& origin) {
|
||||
v8::ScriptCompiler::Source src(source, origin);
|
||||
return v8::ScriptCompiler::CompileUnboundScript(
|
||||
v8::Isolate::GetCurrent(), &src);
|
||||
}
|
||||
#else
|
||||
Factory<v8::UnboundScript>::return_t
|
||||
Factory<v8::UnboundScript>::New(v8::Local<v8::String> source) {
|
||||
v8::ScriptCompiler::Source src(source);
|
||||
return Factory<v8::UnboundScript>::return_t(
|
||||
v8::ScriptCompiler::CompileUnbound(v8::Isolate::GetCurrent(), &src));
|
||||
}
|
||||
|
||||
Factory<v8::UnboundScript>::return_t
|
||||
Factory<v8::UnboundScript>::New( v8::Local<v8::String> source
|
||||
, v8::ScriptOrigin const& origin) {
|
||||
v8::ScriptCompiler::Source src(source, origin);
|
||||
return Factory<v8::UnboundScript>::return_t(
|
||||
v8::ScriptCompiler::CompileUnbound(v8::Isolate::GetCurrent(), &src));
|
||||
}
|
||||
#endif
|
||||
|
||||
} // end of namespace imp
|
||||
|
||||
//=== Presistents and Handles ==================================================
|
||||
|
||||
#if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION
|
||||
template <typename T>
|
||||
inline v8::Local<T> New(v8::Handle<T> h) {
|
||||
return v8::Local<T>::New(v8::Isolate::GetCurrent(), h);
|
||||
}
|
||||
#endif
|
||||
|
||||
template <typename T, typename M>
|
||||
inline v8::Local<T> New(v8::Persistent<T, M> const& p) {
|
||||
return v8::Local<T>::New(v8::Isolate::GetCurrent(), p);
|
||||
}
|
||||
|
||||
template <typename T, typename M>
|
||||
inline v8::Local<T> New(Persistent<T, M> const& p) {
|
||||
return v8::Local<T>::New(v8::Isolate::GetCurrent(), p);
|
||||
}
|
||||
|
||||
#endif // NAN_IMPLEMENTATION_12_INL_H_
|
||||
259
node_modules/sqlite3/node_modules/nan/nan_implementation_pre_12_inl.h
generated
vendored
Normal file
259
node_modules/sqlite3/node_modules/nan/nan_implementation_pre_12_inl.h
generated
vendored
Normal file
@@ -0,0 +1,259 @@
|
||||
/*********************************************************************
|
||||
* NAN - Native Abstractions for Node.js
|
||||
*
|
||||
* Copyright (c) 2015 NAN contributors
|
||||
*
|
||||
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
|
||||
********************************************************************/
|
||||
|
||||
#ifndef NAN_IMPLEMENTATION_PRE_12_INL_H_
|
||||
#define NAN_IMPLEMENTATION_PRE_12_INL_H_
|
||||
|
||||
//==============================================================================
|
||||
// node v0.10 implementation
|
||||
//==============================================================================
|
||||
|
||||
namespace imp {
|
||||
|
||||
//=== Array ====================================================================
|
||||
|
||||
Factory<v8::Array>::return_t
|
||||
Factory<v8::Array>::New() {
|
||||
return v8::Array::New();
|
||||
}
|
||||
|
||||
Factory<v8::Array>::return_t
|
||||
Factory<v8::Array>::New(int length) {
|
||||
return v8::Array::New(length);
|
||||
}
|
||||
|
||||
//=== Boolean ==================================================================
|
||||
|
||||
Factory<v8::Boolean>::return_t
|
||||
Factory<v8::Boolean>::New(bool value) {
|
||||
return v8::Boolean::New(value)->ToBoolean();
|
||||
}
|
||||
|
||||
//=== Boolean Object ===========================================================
|
||||
|
||||
Factory<v8::BooleanObject>::return_t
|
||||
Factory<v8::BooleanObject>::New(bool value) {
|
||||
return v8::BooleanObject::New(value).As<v8::BooleanObject>();
|
||||
}
|
||||
|
||||
//=== Context ==================================================================
|
||||
|
||||
Factory<v8::Context>::return_t
|
||||
Factory<v8::Context>::New( v8::ExtensionConfiguration* extensions
|
||||
, v8::Local<v8::ObjectTemplate> tmpl
|
||||
, v8::Local<v8::Value> obj) {
|
||||
v8::Persistent<v8::Context> ctx = v8::Context::New(extensions, tmpl, obj);
|
||||
v8::Local<v8::Context> lctx = v8::Local<v8::Context>::New(ctx);
|
||||
ctx.Dispose();
|
||||
return lctx;
|
||||
}
|
||||
|
||||
//=== Date =====================================================================
|
||||
|
||||
Factory<v8::Date>::return_t
|
||||
Factory<v8::Date>::New(double value) {
|
||||
return Factory<v8::Date>::return_t(v8::Date::New(value).As<v8::Date>());
|
||||
}
|
||||
|
||||
//=== External =================================================================
|
||||
|
||||
Factory<v8::External>::return_t
|
||||
Factory<v8::External>::New(void * value) {
|
||||
return v8::External::New(value);
|
||||
}
|
||||
|
||||
//=== Function =================================================================
|
||||
|
||||
Factory<v8::Function>::return_t
|
||||
Factory<v8::Function>::New( FunctionCallback callback
|
||||
, v8::Local<v8::Value> data) {
|
||||
return Factory<v8::FunctionTemplate>::New( callback
|
||||
, data
|
||||
, v8::Local<v8::Signature>()
|
||||
)->GetFunction();
|
||||
}
|
||||
|
||||
|
||||
//=== FunctionTemplate =========================================================
|
||||
|
||||
Factory<v8::FunctionTemplate>::return_t
|
||||
Factory<v8::FunctionTemplate>::New( FunctionCallback callback
|
||||
, v8::Local<v8::Value> data
|
||||
, v8::Local<v8::Signature> signature) {
|
||||
if (callback) {
|
||||
v8::HandleScope scope;
|
||||
|
||||
v8::Local<v8::ObjectTemplate> tpl = v8::ObjectTemplate::New();
|
||||
tpl->SetInternalFieldCount(imp::kFunctionFieldCount);
|
||||
v8::Local<v8::Object> obj = tpl->NewInstance();
|
||||
|
||||
obj->SetInternalField(
|
||||
imp::kFunctionIndex
|
||||
, v8::External::New(reinterpret_cast<void *>(callback)));
|
||||
|
||||
v8::Local<v8::Value> val = v8::Local<v8::Value>::New(data);
|
||||
|
||||
if (!val.IsEmpty()) {
|
||||
obj->SetInternalField(imp::kDataIndex, val);
|
||||
}
|
||||
|
||||
// Note(agnat): Emulate length argument here. Unfortunately, I couldn't find
|
||||
// a way. Have at it though...
|
||||
return scope.Close(
|
||||
v8::FunctionTemplate::New(imp::FunctionCallbackWrapper
|
||||
, obj
|
||||
, signature));
|
||||
} else {
|
||||
return v8::FunctionTemplate::New(0, data, signature);
|
||||
}
|
||||
}
|
||||
|
||||
//=== Number ===================================================================
|
||||
|
||||
Factory<v8::Number>::return_t
|
||||
Factory<v8::Number>::New(double value) {
|
||||
return v8::Number::New(value);
|
||||
}
|
||||
|
||||
//=== Number Object ============================================================
|
||||
|
||||
Factory<v8::NumberObject>::return_t
|
||||
Factory<v8::NumberObject>::New(double value) {
|
||||
return v8::NumberObject::New(value).As<v8::NumberObject>();
|
||||
}
|
||||
|
||||
//=== Integer, Int32 and Uint32 ================================================
|
||||
|
||||
template <typename T>
|
||||
typename IntegerFactory<T>::return_t
|
||||
IntegerFactory<T>::New(int32_t value) {
|
||||
return To<T>(T::New(value));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
typename IntegerFactory<T>::return_t
|
||||
IntegerFactory<T>::New(uint32_t value) {
|
||||
return To<T>(T::NewFromUnsigned(value));
|
||||
}
|
||||
|
||||
Factory<v8::Uint32>::return_t
|
||||
Factory<v8::Uint32>::New(int32_t value) {
|
||||
return To<v8::Uint32>(v8::Uint32::NewFromUnsigned(value));
|
||||
}
|
||||
|
||||
Factory<v8::Uint32>::return_t
|
||||
Factory<v8::Uint32>::New(uint32_t value) {
|
||||
return To<v8::Uint32>(v8::Uint32::NewFromUnsigned(value));
|
||||
}
|
||||
|
||||
|
||||
//=== Object ===================================================================
|
||||
|
||||
Factory<v8::Object>::return_t
|
||||
Factory<v8::Object>::New() {
|
||||
return v8::Object::New();
|
||||
}
|
||||
|
||||
//=== Object Template ==========================================================
|
||||
|
||||
Factory<v8::ObjectTemplate>::return_t
|
||||
Factory<v8::ObjectTemplate>::New() {
|
||||
return v8::ObjectTemplate::New();
|
||||
}
|
||||
|
||||
//=== RegExp ===================================================================
|
||||
|
||||
Factory<v8::RegExp>::return_t
|
||||
Factory<v8::RegExp>::New(
|
||||
v8::Local<v8::String> pattern
|
||||
, v8::RegExp::Flags flags) {
|
||||
return Factory<v8::RegExp>::return_t(v8::RegExp::New(pattern, flags));
|
||||
}
|
||||
|
||||
//=== Script ===================================================================
|
||||
|
||||
Factory<v8::Script>::return_t
|
||||
Factory<v8::Script>::New( v8::Local<v8::String> source) {
|
||||
return Factory<v8::Script>::return_t(v8::Script::New(source));
|
||||
}
|
||||
Factory<v8::Script>::return_t
|
||||
Factory<v8::Script>::New( v8::Local<v8::String> source
|
||||
, v8::ScriptOrigin const& origin) {
|
||||
return Factory<v8::Script>::return_t(
|
||||
v8::Script::New(source, const_cast<v8::ScriptOrigin*>(&origin)));
|
||||
}
|
||||
|
||||
//=== Signature ================================================================
|
||||
|
||||
Factory<v8::Signature>::return_t
|
||||
Factory<v8::Signature>::New(Factory<v8::Signature>::FTH receiver) {
|
||||
return v8::Signature::New(receiver);
|
||||
}
|
||||
|
||||
//=== String ===================================================================
|
||||
|
||||
Factory<v8::String>::return_t
|
||||
Factory<v8::String>::New() {
|
||||
return Factory<v8::String>::return_t(v8::String::Empty());
|
||||
}
|
||||
|
||||
Factory<v8::String>::return_t
|
||||
Factory<v8::String>::New(const char * value, int length) {
|
||||
return Factory<v8::String>::return_t(v8::String::New(value, length));
|
||||
}
|
||||
|
||||
Factory<v8::String>::return_t
|
||||
Factory<v8::String>::New(
|
||||
std::string const& value) /* NOLINT(build/include_what_you_use) */ {
|
||||
assert(value.size() <= INT_MAX && "string too long");
|
||||
return Factory<v8::String>::return_t(
|
||||
v8::String::New( value.data(), static_cast<int>(value.size())));
|
||||
}
|
||||
|
||||
Factory<v8::String>::return_t
|
||||
Factory<v8::String>::New(const uint16_t * value, int length) {
|
||||
return Factory<v8::String>::return_t(v8::String::New(value, length));
|
||||
}
|
||||
|
||||
Factory<v8::String>::return_t
|
||||
Factory<v8::String>::New(v8::String::ExternalStringResource * value) {
|
||||
return Factory<v8::String>::return_t(v8::String::NewExternal(value));
|
||||
}
|
||||
|
||||
Factory<v8::String>::return_t
|
||||
Factory<v8::String>::New(v8::String::ExternalAsciiStringResource * value) {
|
||||
return Factory<v8::String>::return_t(v8::String::NewExternal(value));
|
||||
}
|
||||
|
||||
//=== String Object ============================================================
|
||||
|
||||
Factory<v8::StringObject>::return_t
|
||||
Factory<v8::StringObject>::New(v8::Local<v8::String> value) {
|
||||
return v8::StringObject::New(value).As<v8::StringObject>();
|
||||
}
|
||||
|
||||
} // end of namespace imp
|
||||
|
||||
//=== Presistents and Handles ==================================================
|
||||
|
||||
template <typename T>
|
||||
inline v8::Local<T> New(v8::Handle<T> h) {
|
||||
return v8::Local<T>::New(h);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline v8::Local<T> New(v8::Persistent<T> const& p) {
|
||||
return v8::Local<T>::New(p);
|
||||
}
|
||||
|
||||
template <typename T, typename M>
|
||||
inline v8::Local<T> New(Persistent<T, M> const& p) {
|
||||
return v8::Local<T>::New(p.persistent);
|
||||
}
|
||||
|
||||
#endif // NAN_IMPLEMENTATION_PRE_12_INL_H_
|
||||
224
node_modules/sqlite3/node_modules/nan/nan_maybe_43_inl.h
generated
vendored
Normal file
224
node_modules/sqlite3/node_modules/nan/nan_maybe_43_inl.h
generated
vendored
Normal file
@@ -0,0 +1,224 @@
|
||||
/*********************************************************************
|
||||
* NAN - Native Abstractions for Node.js
|
||||
*
|
||||
* Copyright (c) 2015 NAN contributors
|
||||
*
|
||||
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
|
||||
********************************************************************/
|
||||
|
||||
#ifndef NAN_MAYBE_43_INL_H_
|
||||
#define NAN_MAYBE_43_INL_H_
|
||||
|
||||
template<typename T>
|
||||
using MaybeLocal = v8::MaybeLocal<T>;
|
||||
|
||||
template<typename T>
|
||||
using Maybe = v8::Maybe<T>;
|
||||
|
||||
template<typename T>
|
||||
NAN_INLINE Maybe<T> Nothing() {
|
||||
return v8::Nothing<T>();
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
NAN_INLINE Maybe<T> Just(const T& t) {
|
||||
return v8::Just<T>(t);
|
||||
}
|
||||
|
||||
v8::Local<v8::Context> GetCurrentContext();
|
||||
|
||||
NAN_INLINE
|
||||
MaybeLocal<v8::String> ToDetailString(v8::Local<v8::Value> val) {
|
||||
return val->ToDetailString(GetCurrentContext());
|
||||
}
|
||||
|
||||
NAN_INLINE
|
||||
MaybeLocal<v8::Uint32> ToArrayIndex(v8::Local<v8::Value> val) {
|
||||
return val->ToArrayIndex(GetCurrentContext());
|
||||
}
|
||||
|
||||
NAN_INLINE
|
||||
Maybe<bool> Equals(v8::Local<v8::Value> a, v8::Local<v8::Value>(b)) {
|
||||
return a->Equals(GetCurrentContext(), b);
|
||||
}
|
||||
|
||||
NAN_INLINE
|
||||
MaybeLocal<v8::Object> NewInstance(v8::Local<v8::Function> h) {
|
||||
return MaybeLocal<v8::Object>(h->NewInstance(GetCurrentContext()));
|
||||
}
|
||||
|
||||
NAN_INLINE
|
||||
MaybeLocal<v8::Object> NewInstance(
|
||||
v8::Local<v8::Function> h
|
||||
, int argc
|
||||
, v8::Local<v8::Value> argv[]) {
|
||||
return MaybeLocal<v8::Object>(h->NewInstance(GetCurrentContext(),
|
||||
argc, argv));
|
||||
}
|
||||
|
||||
NAN_INLINE
|
||||
MaybeLocal<v8::Object> NewInstance(v8::Local<v8::ObjectTemplate> h) {
|
||||
return MaybeLocal<v8::Object>(h->NewInstance(GetCurrentContext()));
|
||||
}
|
||||
|
||||
|
||||
NAN_INLINE MaybeLocal<v8::Function> GetFunction(
|
||||
v8::Local<v8::FunctionTemplate> t) {
|
||||
return t->GetFunction(GetCurrentContext());
|
||||
}
|
||||
|
||||
NAN_INLINE Maybe<bool> Set(
|
||||
v8::Local<v8::Object> obj
|
||||
, v8::Local<v8::Value> key
|
||||
, v8::Local<v8::Value> value) {
|
||||
return obj->Set(GetCurrentContext(), key, value);
|
||||
}
|
||||
|
||||
NAN_INLINE Maybe<bool> Set(
|
||||
v8::Local<v8::Object> obj
|
||||
, uint32_t index
|
||||
, v8::Local<v8::Value> value) {
|
||||
return obj->Set(GetCurrentContext(), index, value);
|
||||
}
|
||||
|
||||
NAN_INLINE Maybe<bool> ForceSet(
|
||||
v8::Local<v8::Object> obj
|
||||
, v8::Local<v8::Value> key
|
||||
, v8::Local<v8::Value> value
|
||||
, v8::PropertyAttribute attribs = v8::None) {
|
||||
return obj->ForceSet(GetCurrentContext(), key, value, attribs);
|
||||
}
|
||||
|
||||
NAN_INLINE MaybeLocal<v8::Value> Get(
|
||||
v8::Local<v8::Object> obj
|
||||
, v8::Local<v8::Value> key) {
|
||||
return obj->Get(GetCurrentContext(), key);
|
||||
}
|
||||
|
||||
NAN_INLINE
|
||||
MaybeLocal<v8::Value> Get(v8::Local<v8::Object> obj, uint32_t index) {
|
||||
return obj->Get(GetCurrentContext(), index);
|
||||
}
|
||||
|
||||
NAN_INLINE v8::PropertyAttribute GetPropertyAttributes(
|
||||
v8::Local<v8::Object> obj
|
||||
, v8::Local<v8::Value> key) {
|
||||
return obj->GetPropertyAttributes(GetCurrentContext(), key).FromJust();
|
||||
}
|
||||
|
||||
NAN_INLINE Maybe<bool> Has(
|
||||
v8::Local<v8::Object> obj
|
||||
, v8::Local<v8::String> key) {
|
||||
return obj->Has(GetCurrentContext(), key);
|
||||
}
|
||||
|
||||
NAN_INLINE Maybe<bool> Has(v8::Local<v8::Object> obj, uint32_t index) {
|
||||
return obj->Has(GetCurrentContext(), index);
|
||||
}
|
||||
|
||||
NAN_INLINE Maybe<bool> Delete(
|
||||
v8::Local<v8::Object> obj
|
||||
, v8::Local<v8::String> key) {
|
||||
return obj->Delete(GetCurrentContext(), key);
|
||||
}
|
||||
|
||||
NAN_INLINE
|
||||
Maybe<bool> Delete(v8::Local<v8::Object> obj, uint32_t index) {
|
||||
return obj->Delete(GetCurrentContext(), index);
|
||||
}
|
||||
|
||||
NAN_INLINE
|
||||
MaybeLocal<v8::Array> GetPropertyNames(v8::Local<v8::Object> obj) {
|
||||
return obj->GetPropertyNames(GetCurrentContext());
|
||||
}
|
||||
|
||||
NAN_INLINE
|
||||
MaybeLocal<v8::Array> GetOwnPropertyNames(v8::Local<v8::Object> obj) {
|
||||
return obj->GetOwnPropertyNames(GetCurrentContext());
|
||||
}
|
||||
|
||||
NAN_INLINE Maybe<bool> SetPrototype(
|
||||
v8::Local<v8::Object> obj
|
||||
, v8::Local<v8::Value> prototype) {
|
||||
return obj->SetPrototype(GetCurrentContext(), prototype);
|
||||
}
|
||||
|
||||
NAN_INLINE MaybeLocal<v8::String> ObjectProtoToString(
|
||||
v8::Local<v8::Object> obj) {
|
||||
return obj->ObjectProtoToString(GetCurrentContext());
|
||||
}
|
||||
|
||||
NAN_INLINE Maybe<bool> HasOwnProperty(
|
||||
v8::Local<v8::Object> obj
|
||||
, v8::Local<v8::String> key) {
|
||||
return obj->HasOwnProperty(GetCurrentContext(), key);
|
||||
}
|
||||
|
||||
NAN_INLINE Maybe<bool> HasRealNamedProperty(
|
||||
v8::Local<v8::Object> obj
|
||||
, v8::Local<v8::String> key) {
|
||||
return obj->HasRealNamedProperty(GetCurrentContext(), key);
|
||||
}
|
||||
|
||||
NAN_INLINE Maybe<bool> HasRealIndexedProperty(
|
||||
v8::Local<v8::Object> obj
|
||||
, uint32_t index) {
|
||||
return obj->HasRealIndexedProperty(GetCurrentContext(), index);
|
||||
}
|
||||
|
||||
NAN_INLINE Maybe<bool> HasRealNamedCallbackProperty(
|
||||
v8::Local<v8::Object> obj
|
||||
, v8::Local<v8::String> key) {
|
||||
return obj->HasRealNamedCallbackProperty(GetCurrentContext(), key);
|
||||
}
|
||||
|
||||
NAN_INLINE MaybeLocal<v8::Value> GetRealNamedPropertyInPrototypeChain(
|
||||
v8::Local<v8::Object> obj
|
||||
, v8::Local<v8::String> key) {
|
||||
return obj->GetRealNamedPropertyInPrototypeChain(GetCurrentContext(), key);
|
||||
}
|
||||
|
||||
NAN_INLINE MaybeLocal<v8::Value> GetRealNamedProperty(
|
||||
v8::Local<v8::Object> obj
|
||||
, v8::Local<v8::String> key) {
|
||||
return obj->GetRealNamedProperty(GetCurrentContext(), key);
|
||||
}
|
||||
|
||||
NAN_INLINE MaybeLocal<v8::Value> CallAsFunction(
|
||||
v8::Local<v8::Object> obj
|
||||
, v8::Local<v8::Object> recv
|
||||
, int argc
|
||||
, v8::Local<v8::Value> argv[]) {
|
||||
return obj->CallAsFunction(GetCurrentContext(), recv, argc, argv);
|
||||
}
|
||||
|
||||
NAN_INLINE MaybeLocal<v8::Value> CallAsConstructor(
|
||||
v8::Local<v8::Object> obj
|
||||
, int argc, v8::Local<v8::Value> argv[]) {
|
||||
return obj->CallAsConstructor(GetCurrentContext(), argc, argv);
|
||||
}
|
||||
|
||||
NAN_INLINE
|
||||
MaybeLocal<v8::String> GetSourceLine(v8::Local<v8::Message> msg) {
|
||||
return msg->GetSourceLine(GetCurrentContext());
|
||||
}
|
||||
|
||||
NAN_INLINE Maybe<int> GetLineNumber(v8::Local<v8::Message> msg) {
|
||||
return msg->GetLineNumber(GetCurrentContext());
|
||||
}
|
||||
|
||||
NAN_INLINE Maybe<int> GetStartColumn(v8::Local<v8::Message> msg) {
|
||||
return msg->GetStartColumn(GetCurrentContext());
|
||||
}
|
||||
|
||||
NAN_INLINE Maybe<int> GetEndColumn(v8::Local<v8::Message> msg) {
|
||||
return msg->GetEndColumn(GetCurrentContext());
|
||||
}
|
||||
|
||||
NAN_INLINE MaybeLocal<v8::Object> CloneElementAt(
|
||||
v8::Local<v8::Array> array
|
||||
, uint32_t index) {
|
||||
return array->CloneElementAt(GetCurrentContext(), index);
|
||||
}
|
||||
|
||||
#endif // NAN_MAYBE_43_INL_H_
|
||||
295
node_modules/sqlite3/node_modules/nan/nan_maybe_pre_43_inl.h
generated
vendored
Normal file
295
node_modules/sqlite3/node_modules/nan/nan_maybe_pre_43_inl.h
generated
vendored
Normal file
@@ -0,0 +1,295 @@
|
||||
/*********************************************************************
|
||||
* NAN - Native Abstractions for Node.js
|
||||
*
|
||||
* Copyright (c) 2015 NAN contributors
|
||||
*
|
||||
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
|
||||
********************************************************************/
|
||||
|
||||
#ifndef NAN_MAYBE_PRE_43_INL_H_
|
||||
#define NAN_MAYBE_PRE_43_INL_H_
|
||||
|
||||
template<typename T>
|
||||
class MaybeLocal {
|
||||
public:
|
||||
NAN_INLINE MaybeLocal() : val_(v8::Local<T>()) {}
|
||||
|
||||
template<typename S>
|
||||
# if NODE_MODULE_VERSION >= NODE_0_12_MODULE_VERSION
|
||||
NAN_INLINE MaybeLocal(v8::Local<S> that) : val_(that) {}
|
||||
# else
|
||||
NAN_INLINE MaybeLocal(v8::Local<S> that) :
|
||||
val_(*reinterpret_cast<v8::Local<T>*>(&that)) {}
|
||||
# endif
|
||||
|
||||
NAN_INLINE bool IsEmpty() const { return val_.IsEmpty(); }
|
||||
|
||||
template<typename S>
|
||||
NAN_INLINE bool ToLocal(v8::Local<S> *out) const {
|
||||
*out = val_;
|
||||
return !IsEmpty();
|
||||
}
|
||||
|
||||
NAN_INLINE v8::Local<T> ToLocalChecked() const {
|
||||
#if defined(V8_ENABLE_CHECKS)
|
||||
assert(!IsEmpty() && "ToLocalChecked is Empty");
|
||||
#endif // V8_ENABLE_CHECKS
|
||||
return val_;
|
||||
}
|
||||
|
||||
template<typename S>
|
||||
NAN_INLINE v8::Local<S> FromMaybe(v8::Local<S> default_value) const {
|
||||
return IsEmpty() ? default_value : val_;
|
||||
}
|
||||
|
||||
private:
|
||||
v8::Local<T> val_;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
class Maybe {
|
||||
public:
|
||||
NAN_INLINE bool IsNothing() const { return !has_value_; }
|
||||
NAN_INLINE bool IsJust() const { return has_value_; }
|
||||
|
||||
NAN_INLINE T FromJust() const {
|
||||
#if defined(V8_ENABLE_CHECKS)
|
||||
assert(IsJust() && "FromJust is Nothing");
|
||||
#endif // V8_ENABLE_CHECKS
|
||||
return value_;
|
||||
}
|
||||
|
||||
NAN_INLINE T FromMaybe(const T& default_value) const {
|
||||
return has_value_ ? value_ : default_value;
|
||||
}
|
||||
|
||||
NAN_INLINE bool operator==(const Maybe &other) const {
|
||||
return (IsJust() == other.IsJust()) &&
|
||||
(!IsJust() || FromJust() == other.FromJust());
|
||||
}
|
||||
|
||||
NAN_INLINE bool operator!=(const Maybe &other) const {
|
||||
return !operator==(other);
|
||||
}
|
||||
|
||||
private:
|
||||
Maybe() : has_value_(false) {}
|
||||
explicit Maybe(const T& t) : has_value_(true), value_(t) {}
|
||||
bool has_value_;
|
||||
T value_;
|
||||
|
||||
template<typename U>
|
||||
friend Maybe<U> Nothing();
|
||||
template<typename U>
|
||||
friend Maybe<U> Just(const U& u);
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
inline Maybe<T> Nothing() {
|
||||
return Maybe<T>();
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline Maybe<T> Just(const T& t) {
|
||||
return Maybe<T>(t);
|
||||
}
|
||||
|
||||
NAN_INLINE
|
||||
MaybeLocal<v8::String> ToDetailString(v8::Handle<v8::Value> val) {
|
||||
return MaybeLocal<v8::String>(val->ToDetailString());
|
||||
}
|
||||
|
||||
NAN_INLINE
|
||||
MaybeLocal<v8::Uint32> ToArrayIndex(v8::Handle<v8::Value> val) {
|
||||
return MaybeLocal<v8::Uint32>(val->ToArrayIndex());
|
||||
}
|
||||
|
||||
NAN_INLINE
|
||||
Maybe<bool> Equals(v8::Handle<v8::Value> a, v8::Handle<v8::Value>(b)) {
|
||||
return Just<bool>(a->Equals(b));
|
||||
}
|
||||
|
||||
NAN_INLINE
|
||||
MaybeLocal<v8::Object> NewInstance(v8::Handle<v8::Function> h) {
|
||||
return MaybeLocal<v8::Object>(h->NewInstance());
|
||||
}
|
||||
|
||||
NAN_INLINE
|
||||
MaybeLocal<v8::Object> NewInstance(
|
||||
v8::Local<v8::Function> h
|
||||
, int argc
|
||||
, v8::Local<v8::Value> argv[]) {
|
||||
return MaybeLocal<v8::Object>(h->NewInstance(argc, argv));
|
||||
}
|
||||
|
||||
NAN_INLINE
|
||||
MaybeLocal<v8::Object> NewInstance(v8::Handle<v8::ObjectTemplate> h) {
|
||||
return MaybeLocal<v8::Object>(h->NewInstance());
|
||||
}
|
||||
|
||||
NAN_INLINE
|
||||
MaybeLocal<v8::Function> GetFunction(v8::Handle<v8::FunctionTemplate> t) {
|
||||
return MaybeLocal<v8::Function>(t->GetFunction());
|
||||
}
|
||||
|
||||
NAN_INLINE Maybe<bool> Set(
|
||||
v8::Handle<v8::Object> obj
|
||||
, v8::Handle<v8::Value> key
|
||||
, v8::Handle<v8::Value> value) {
|
||||
return Just<bool>(obj->Set(key, value));
|
||||
}
|
||||
|
||||
NAN_INLINE Maybe<bool> Set(
|
||||
v8::Handle<v8::Object> obj
|
||||
, uint32_t index
|
||||
, v8::Handle<v8::Value> value) {
|
||||
return Just<bool>(obj->Set(index, value));
|
||||
}
|
||||
|
||||
NAN_INLINE Maybe<bool> ForceSet(
|
||||
v8::Handle<v8::Object> obj
|
||||
, v8::Handle<v8::Value> key
|
||||
, v8::Handle<v8::Value> value
|
||||
, v8::PropertyAttribute attribs = v8::None) {
|
||||
return Just<bool>(obj->ForceSet(key, value, attribs));
|
||||
}
|
||||
|
||||
NAN_INLINE MaybeLocal<v8::Value> Get(
|
||||
v8::Handle<v8::Object> obj
|
||||
, v8::Handle<v8::Value> key) {
|
||||
return MaybeLocal<v8::Value>(obj->Get(key));
|
||||
}
|
||||
|
||||
NAN_INLINE MaybeLocal<v8::Value> Get(
|
||||
v8::Handle<v8::Object> obj
|
||||
, uint32_t index) {
|
||||
return MaybeLocal<v8::Value>(obj->Get(index));
|
||||
}
|
||||
|
||||
NAN_INLINE Maybe<v8::PropertyAttribute> GetPropertyAttributes(
|
||||
v8::Handle<v8::Object> obj
|
||||
, v8::Handle<v8::Value> key) {
|
||||
return Just<v8::PropertyAttribute>(obj->GetPropertyAttributes(key));
|
||||
}
|
||||
|
||||
NAN_INLINE Maybe<bool> Has(
|
||||
v8::Handle<v8::Object> obj
|
||||
, v8::Handle<v8::String> key) {
|
||||
return Just<bool>(obj->Has(key));
|
||||
}
|
||||
|
||||
NAN_INLINE Maybe<bool> Has(
|
||||
v8::Handle<v8::Object> obj
|
||||
, uint32_t index) {
|
||||
return Just<bool>(obj->Has(index));
|
||||
}
|
||||
|
||||
NAN_INLINE Maybe<bool> Delete(
|
||||
v8::Handle<v8::Object> obj
|
||||
, v8::Handle<v8::String> key) {
|
||||
return Just<bool>(obj->Delete(key));
|
||||
}
|
||||
|
||||
NAN_INLINE Maybe<bool> Delete(
|
||||
v8::Handle<v8::Object> obj
|
||||
, uint32_t index) {
|
||||
return Just<bool>(obj->Delete(index));
|
||||
}
|
||||
|
||||
NAN_INLINE
|
||||
MaybeLocal<v8::Array> GetPropertyNames(v8::Handle<v8::Object> obj) {
|
||||
return MaybeLocal<v8::Array>(obj->GetPropertyNames());
|
||||
}
|
||||
|
||||
NAN_INLINE
|
||||
MaybeLocal<v8::Array> GetOwnPropertyNames(v8::Handle<v8::Object> obj) {
|
||||
return MaybeLocal<v8::Array>(obj->GetOwnPropertyNames());
|
||||
}
|
||||
|
||||
NAN_INLINE Maybe<bool> SetPrototype(
|
||||
v8::Handle<v8::Object> obj
|
||||
, v8::Handle<v8::Value> prototype) {
|
||||
return Just<bool>(obj->SetPrototype(prototype));
|
||||
}
|
||||
|
||||
NAN_INLINE MaybeLocal<v8::String> ObjectProtoToString(
|
||||
v8::Handle<v8::Object> obj) {
|
||||
return MaybeLocal<v8::String>(obj->ObjectProtoToString());
|
||||
}
|
||||
|
||||
NAN_INLINE Maybe<bool> HasOwnProperty(
|
||||
v8::Handle<v8::Object> obj
|
||||
, v8::Handle<v8::String> key) {
|
||||
return Just<bool>(obj->HasOwnProperty(key));
|
||||
}
|
||||
|
||||
NAN_INLINE Maybe<bool> HasRealNamedProperty(
|
||||
v8::Handle<v8::Object> obj
|
||||
, v8::Handle<v8::String> key) {
|
||||
return Just<bool>(obj->HasRealNamedProperty(key));
|
||||
}
|
||||
|
||||
NAN_INLINE Maybe<bool> HasRealIndexedProperty(
|
||||
v8::Handle<v8::Object> obj
|
||||
, uint32_t index) {
|
||||
return Just<bool>(obj->HasRealIndexedProperty(index));
|
||||
}
|
||||
|
||||
NAN_INLINE Maybe<bool> HasRealNamedCallbackProperty(
|
||||
v8::Handle<v8::Object> obj
|
||||
, v8::Handle<v8::String> key) {
|
||||
return Just<bool>(obj->HasRealNamedCallbackProperty(key));
|
||||
}
|
||||
|
||||
NAN_INLINE MaybeLocal<v8::Value> GetRealNamedPropertyInPrototypeChain(
|
||||
v8::Handle<v8::Object> obj
|
||||
, v8::Handle<v8::String> key) {
|
||||
return MaybeLocal<v8::Value>(
|
||||
obj->GetRealNamedPropertyInPrototypeChain(key));
|
||||
}
|
||||
|
||||
NAN_INLINE MaybeLocal<v8::Value> GetRealNamedProperty(
|
||||
v8::Handle<v8::Object> obj
|
||||
, v8::Handle<v8::String> key) {
|
||||
return MaybeLocal<v8::Value>(obj->GetRealNamedProperty(key));
|
||||
}
|
||||
|
||||
NAN_INLINE MaybeLocal<v8::Value> CallAsFunction(
|
||||
v8::Handle<v8::Object> obj
|
||||
, v8::Handle<v8::Object> recv
|
||||
, int argc
|
||||
, v8::Handle<v8::Value> argv[]) {
|
||||
return MaybeLocal<v8::Value>(obj->CallAsFunction(recv, argc, argv));
|
||||
}
|
||||
|
||||
NAN_INLINE MaybeLocal<v8::Value> CallAsConstructor(
|
||||
v8::Handle<v8::Object> obj
|
||||
, int argc
|
||||
, v8::Local<v8::Value> argv[]) {
|
||||
return MaybeLocal<v8::Value>(obj->CallAsConstructor(argc, argv));
|
||||
}
|
||||
|
||||
NAN_INLINE
|
||||
MaybeLocal<v8::String> GetSourceLine(v8::Handle<v8::Message> msg) {
|
||||
return MaybeLocal<v8::String>(msg->GetSourceLine());
|
||||
}
|
||||
|
||||
NAN_INLINE Maybe<int> GetLineNumber(v8::Handle<v8::Message> msg) {
|
||||
return Just<int>(msg->GetLineNumber());
|
||||
}
|
||||
|
||||
NAN_INLINE Maybe<int> GetStartColumn(v8::Handle<v8::Message> msg) {
|
||||
return Just<int>(msg->GetStartColumn());
|
||||
}
|
||||
|
||||
NAN_INLINE Maybe<int> GetEndColumn(v8::Handle<v8::Message> msg) {
|
||||
return Just<int>(msg->GetEndColumn());
|
||||
}
|
||||
|
||||
NAN_INLINE MaybeLocal<v8::Object> CloneElementAt(
|
||||
v8::Handle<v8::Array> array
|
||||
, uint32_t index) {
|
||||
return MaybeLocal<v8::Object>(array->CloneElementAt(index));
|
||||
}
|
||||
|
||||
#endif // NAN_MAYBE_PRE_43_INL_H_
|
||||
332
node_modules/sqlite3/node_modules/nan/nan_new.h
generated
vendored
Normal file
332
node_modules/sqlite3/node_modules/nan/nan_new.h
generated
vendored
Normal file
@@ -0,0 +1,332 @@
|
||||
/*********************************************************************
|
||||
* NAN - Native Abstractions for Node.js
|
||||
*
|
||||
* Copyright (c) 2015 NAN contributors
|
||||
*
|
||||
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
|
||||
********************************************************************/
|
||||
|
||||
#ifndef NAN_NEW_H_
|
||||
#define NAN_NEW_H_
|
||||
|
||||
namespace imp { // scnr
|
||||
|
||||
// TODO(agnat): Generalize
|
||||
template <typename T> v8::Local<T> To(v8::Local<v8::Integer> i);
|
||||
|
||||
template <>
|
||||
inline
|
||||
v8::Local<v8::Integer>
|
||||
To<v8::Integer>(v8::Local<v8::Integer> i) {
|
||||
return Nan::To<v8::Integer>(i).ToLocalChecked();
|
||||
}
|
||||
|
||||
template <>
|
||||
inline
|
||||
v8::Local<v8::Int32>
|
||||
To<v8::Int32>(v8::Local<v8::Integer> i) {
|
||||
return Nan::To<v8::Int32>(i).ToLocalChecked();
|
||||
}
|
||||
|
||||
template <>
|
||||
inline
|
||||
v8::Local<v8::Uint32>
|
||||
To<v8::Uint32>(v8::Local<v8::Integer> i) {
|
||||
return Nan::To<v8::Uint32>(i).ToLocalChecked();
|
||||
}
|
||||
|
||||
template <typename T> struct FactoryBase {
|
||||
typedef v8::Local<T> return_t;
|
||||
};
|
||||
|
||||
template <typename T> struct MaybeFactoryBase {
|
||||
typedef MaybeLocal<T> return_t;
|
||||
};
|
||||
|
||||
template <typename T> struct Factory;
|
||||
|
||||
template <>
|
||||
struct Factory<v8::Array> : FactoryBase<v8::Array> {
|
||||
static inline return_t New();
|
||||
static inline return_t New(int length);
|
||||
};
|
||||
|
||||
template <>
|
||||
struct Factory<v8::Boolean> : FactoryBase<v8::Boolean> {
|
||||
static inline return_t New(bool value);
|
||||
};
|
||||
|
||||
template <>
|
||||
struct Factory<v8::BooleanObject> : FactoryBase<v8::BooleanObject> {
|
||||
static inline return_t New(bool value);
|
||||
};
|
||||
|
||||
template <>
|
||||
struct Factory<v8::Context> : FactoryBase<v8::Context> {
|
||||
static inline
|
||||
return_t
|
||||
New( v8::ExtensionConfiguration* extensions = NULL
|
||||
, v8::Local<v8::ObjectTemplate> tmpl = v8::Local<v8::ObjectTemplate>()
|
||||
, v8::Local<v8::Value> obj = v8::Local<v8::Value>());
|
||||
};
|
||||
|
||||
template <>
|
||||
struct Factory<v8::Date> : MaybeFactoryBase<v8::Date> {
|
||||
static inline return_t New(double value);
|
||||
};
|
||||
|
||||
template <>
|
||||
struct Factory<v8::External> : FactoryBase<v8::External> {
|
||||
static inline return_t New(void *value);
|
||||
};
|
||||
|
||||
template <>
|
||||
struct Factory<v8::Function> : FactoryBase<v8::Function> {
|
||||
static inline
|
||||
return_t
|
||||
New( FunctionCallback callback
|
||||
, v8::Local<v8::Value> data = v8::Local<v8::Value>());
|
||||
};
|
||||
|
||||
template <>
|
||||
struct Factory<v8::FunctionTemplate> : FactoryBase<v8::FunctionTemplate> {
|
||||
static inline
|
||||
return_t
|
||||
New( FunctionCallback callback = NULL
|
||||
, v8::Local<v8::Value> data = v8::Local<v8::Value>()
|
||||
, v8::Local<v8::Signature> signature = v8::Local<v8::Signature>());
|
||||
};
|
||||
|
||||
template <>
|
||||
struct Factory<v8::Number> : FactoryBase<v8::Number> {
|
||||
static inline return_t New(double value);
|
||||
};
|
||||
|
||||
template <>
|
||||
struct Factory<v8::NumberObject> : FactoryBase<v8::NumberObject> {
|
||||
static inline return_t New(double value);
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct IntegerFactory : FactoryBase<T> {
|
||||
typedef typename FactoryBase<T>::return_t return_t;
|
||||
static inline return_t New(int32_t value);
|
||||
static inline return_t New(uint32_t value);
|
||||
};
|
||||
|
||||
template <>
|
||||
struct Factory<v8::Integer> : IntegerFactory<v8::Integer> {};
|
||||
|
||||
template <>
|
||||
struct Factory<v8::Int32> : IntegerFactory<v8::Int32> {};
|
||||
|
||||
template <>
|
||||
struct Factory<v8::Uint32> : FactoryBase<v8::Uint32> {
|
||||
static inline return_t New(int32_t value);
|
||||
static inline return_t New(uint32_t value);
|
||||
};
|
||||
|
||||
template <>
|
||||
struct Factory<v8::Object> : FactoryBase<v8::Object> {
|
||||
static inline return_t New();
|
||||
};
|
||||
|
||||
template <>
|
||||
struct Factory<v8::ObjectTemplate> : FactoryBase<v8::ObjectTemplate> {
|
||||
static inline return_t New();
|
||||
};
|
||||
|
||||
template <>
|
||||
struct Factory<v8::RegExp> : MaybeFactoryBase<v8::RegExp> {
|
||||
static inline return_t New(
|
||||
v8::Local<v8::String> pattern, v8::RegExp::Flags flags);
|
||||
};
|
||||
|
||||
template <>
|
||||
struct Factory<v8::Script> : MaybeFactoryBase<v8::Script> {
|
||||
static inline return_t New( v8::Local<v8::String> source);
|
||||
static inline return_t New( v8::Local<v8::String> source
|
||||
, v8::ScriptOrigin const& origin);
|
||||
};
|
||||
|
||||
template <>
|
||||
struct Factory<v8::Signature> : FactoryBase<v8::Signature> {
|
||||
typedef v8::Local<v8::FunctionTemplate> FTH;
|
||||
static inline return_t New(FTH receiver = FTH());
|
||||
};
|
||||
|
||||
template <>
|
||||
struct Factory<v8::String> : MaybeFactoryBase<v8::String> {
|
||||
static inline return_t New();
|
||||
static inline return_t New(const char *value, int length = -1);
|
||||
static inline return_t New(const uint16_t *value, int length = -1);
|
||||
static inline return_t New(std::string const& value);
|
||||
|
||||
static inline return_t New(v8::String::ExternalStringResource * value);
|
||||
static inline return_t New(ExternalOneByteStringResource * value);
|
||||
};
|
||||
|
||||
template <>
|
||||
struct Factory<v8::StringObject> : FactoryBase<v8::StringObject> {
|
||||
static inline return_t New(v8::Local<v8::String> value);
|
||||
};
|
||||
|
||||
} // end of namespace imp
|
||||
|
||||
#if (NODE_MODULE_VERSION >= 12)
|
||||
|
||||
namespace imp {
|
||||
|
||||
template <>
|
||||
struct Factory<v8::UnboundScript> : MaybeFactoryBase<v8::UnboundScript> {
|
||||
static inline return_t New( v8::Local<v8::String> source);
|
||||
static inline return_t New( v8::Local<v8::String> source
|
||||
, v8::ScriptOrigin const& origin);
|
||||
};
|
||||
|
||||
} // end of namespace imp
|
||||
|
||||
# include "nan_implementation_12_inl.h"
|
||||
|
||||
#else // NODE_MODULE_VERSION >= 12
|
||||
|
||||
# include "nan_implementation_pre_12_inl.h"
|
||||
|
||||
#endif
|
||||
|
||||
//=== API ======================================================================
|
||||
|
||||
template <typename T>
|
||||
typename imp::Factory<T>::return_t
|
||||
New() {
|
||||
return imp::Factory<T>::New();
|
||||
}
|
||||
|
||||
template <typename T, typename A0>
|
||||
typename imp::Factory<T>::return_t
|
||||
New(A0 arg0) {
|
||||
return imp::Factory<T>::New(arg0);
|
||||
}
|
||||
|
||||
template <typename T, typename A0, typename A1>
|
||||
typename imp::Factory<T>::return_t
|
||||
New(A0 arg0, A1 arg1) {
|
||||
return imp::Factory<T>::New(arg0, arg1);
|
||||
}
|
||||
|
||||
template <typename T, typename A0, typename A1, typename A2>
|
||||
typename imp::Factory<T>::return_t
|
||||
New(A0 arg0, A1 arg1, A2 arg2) {
|
||||
return imp::Factory<T>::New(arg0, arg1, arg2);
|
||||
}
|
||||
|
||||
template <typename T, typename A0, typename A1, typename A2, typename A3>
|
||||
typename imp::Factory<T>::return_t
|
||||
New(A0 arg0, A1 arg1, A2 arg2, A3 arg3) {
|
||||
return imp::Factory<T>::New(arg0, arg1, arg2, arg3);
|
||||
}
|
||||
|
||||
// Note(agnat): When passing overloaded function pointers to template functions
|
||||
// as generic arguments the compiler needs help in picking the right overload.
|
||||
// These two functions handle New<Function> and New<FunctionTemplate> with
|
||||
// all argument variations.
|
||||
|
||||
// v8::Function and v8::FunctionTemplate with one or two arguments
|
||||
template <typename T>
|
||||
typename imp::Factory<T>::return_t
|
||||
New( FunctionCallback callback
|
||||
, v8::Local<v8::Value> data = v8::Local<v8::Value>()) {
|
||||
return imp::Factory<T>::New(callback, data);
|
||||
}
|
||||
|
||||
// v8::Function and v8::FunctionTemplate with three arguments
|
||||
template <typename T, typename A2>
|
||||
typename imp::Factory<T>::return_t
|
||||
New( FunctionCallback callback
|
||||
, v8::Local<v8::Value> data = v8::Local<v8::Value>()
|
||||
, A2 a2 = A2()) {
|
||||
return imp::Factory<T>::New(callback, data, a2);
|
||||
}
|
||||
|
||||
// Convenience
|
||||
|
||||
#if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION
|
||||
template <typename T> inline v8::Local<T> New(v8::Handle<T> h);
|
||||
#endif
|
||||
|
||||
#if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION
|
||||
template <typename T, typename M>
|
||||
inline v8::Local<T> New(v8::Persistent<T, M> const& p);
|
||||
#else
|
||||
template <typename T> inline v8::Local<T> New(v8::Persistent<T> const& p);
|
||||
#endif
|
||||
template <typename T, typename M>
|
||||
inline v8::Local<T> New(Persistent<T, M> const& p);
|
||||
|
||||
inline
|
||||
imp::Factory<v8::Boolean>::return_t
|
||||
New(bool value) {
|
||||
return New<v8::Boolean>(value);
|
||||
}
|
||||
|
||||
inline
|
||||
imp::Factory<v8::Int32>::return_t
|
||||
New(int32_t value) {
|
||||
return New<v8::Int32>(value);
|
||||
}
|
||||
|
||||
inline
|
||||
imp::Factory<v8::Uint32>::return_t
|
||||
New(uint32_t value) {
|
||||
return New<v8::Uint32>(value);
|
||||
}
|
||||
|
||||
inline
|
||||
imp::Factory<v8::Number>::return_t
|
||||
New(double value) {
|
||||
return New<v8::Number>(value);
|
||||
}
|
||||
|
||||
inline
|
||||
imp::Factory<v8::String>::return_t
|
||||
New(std::string const& value) { // NOLINT(build/include_what_you_use)
|
||||
return New<v8::String>(value);
|
||||
}
|
||||
|
||||
inline
|
||||
imp::Factory<v8::String>::return_t
|
||||
New(const char * value, int length) {
|
||||
return New<v8::String>(value, length);
|
||||
}
|
||||
|
||||
inline
|
||||
imp::Factory<v8::String>::return_t
|
||||
New(const char * value) {
|
||||
return New<v8::String>(value);
|
||||
}
|
||||
|
||||
inline
|
||||
imp::Factory<v8::String>::return_t
|
||||
New(const uint16_t * value) {
|
||||
return New<v8::String>(value);
|
||||
}
|
||||
|
||||
inline
|
||||
imp::Factory<v8::String>::return_t
|
||||
New(v8::String::ExternalStringResource * value) {
|
||||
return New<v8::String>(value);
|
||||
}
|
||||
|
||||
inline
|
||||
imp::Factory<v8::String>::return_t
|
||||
New(ExternalOneByteStringResource * value) {
|
||||
return New<v8::String>(value);
|
||||
}
|
||||
|
||||
inline
|
||||
imp::Factory<v8::RegExp>::return_t
|
||||
New(v8::Local<v8::String> pattern, v8::RegExp::Flags flags) {
|
||||
return New<v8::RegExp>(pattern, flags);
|
||||
}
|
||||
|
||||
#endif // NAN_NEW_H_
|
||||
155
node_modules/sqlite3/node_modules/nan/nan_object_wrap.h
generated
vendored
Normal file
155
node_modules/sqlite3/node_modules/nan/nan_object_wrap.h
generated
vendored
Normal file
@@ -0,0 +1,155 @@
|
||||
/*********************************************************************
|
||||
* NAN - Native Abstractions for Node.js
|
||||
*
|
||||
* Copyright (c) 2015 NAN contributors
|
||||
*
|
||||
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
|
||||
********************************************************************/
|
||||
|
||||
#ifndef NAN_OBJECT_WRAP_H_
|
||||
#define NAN_OBJECT_WRAP_H_
|
||||
|
||||
class ObjectWrap {
|
||||
public:
|
||||
ObjectWrap() {
|
||||
refs_ = 0;
|
||||
}
|
||||
|
||||
|
||||
virtual ~ObjectWrap() {
|
||||
if (persistent().IsEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
assert(persistent().IsNearDeath());
|
||||
persistent().ClearWeak();
|
||||
persistent().Reset();
|
||||
}
|
||||
|
||||
|
||||
template <class T>
|
||||
static inline T* Unwrap(v8::Local<v8::Object> object) {
|
||||
assert(!object.IsEmpty());
|
||||
assert(object->InternalFieldCount() > 0);
|
||||
// Cast to ObjectWrap before casting to T. A direct cast from void
|
||||
// to T won't work right when T has more than one base class.
|
||||
void* ptr = GetInternalFieldPointer(object, 0);
|
||||
ObjectWrap* wrap = static_cast<ObjectWrap*>(ptr);
|
||||
return static_cast<T*>(wrap);
|
||||
}
|
||||
|
||||
|
||||
inline v8::Local<v8::Object> handle() {
|
||||
return New(persistent());
|
||||
}
|
||||
|
||||
|
||||
inline Persistent<v8::Object>& persistent() {
|
||||
return handle_;
|
||||
}
|
||||
|
||||
|
||||
protected:
|
||||
inline void Wrap(v8::Local<v8::Object> object) {
|
||||
assert(persistent().IsEmpty());
|
||||
assert(object->InternalFieldCount() > 0);
|
||||
SetInternalFieldPointer(object, 0, this);
|
||||
persistent().Reset(object);
|
||||
MakeWeak();
|
||||
}
|
||||
|
||||
#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \
|
||||
(V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3))
|
||||
|
||||
inline void MakeWeak() {
|
||||
persistent().v8::PersistentBase<v8::Object>::SetWeak(
|
||||
this, WeakCallback, v8::WeakCallbackType::kParameter);
|
||||
persistent().MarkIndependent();
|
||||
}
|
||||
|
||||
#elif NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION
|
||||
|
||||
inline void MakeWeak() {
|
||||
persistent().v8::PersistentBase<v8::Object>::SetWeak(this, WeakCallback);
|
||||
persistent().MarkIndependent();
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
inline void MakeWeak() {
|
||||
persistent().persistent.MakeWeak(this, WeakCallback);
|
||||
persistent().MarkIndependent();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* Ref() marks the object as being attached to an event loop.
|
||||
* Refed objects will not be garbage collected, even if
|
||||
* all references are lost.
|
||||
*/
|
||||
virtual void Ref() {
|
||||
assert(!persistent().IsEmpty());
|
||||
persistent().ClearWeak();
|
||||
refs_++;
|
||||
}
|
||||
|
||||
/* Unref() marks an object as detached from the event loop. This is its
|
||||
* default state. When an object with a "weak" reference changes from
|
||||
* attached to detached state it will be freed. Be careful not to access
|
||||
* the object after making this call as it might be gone!
|
||||
* (A "weak reference" means an object that only has a
|
||||
* persistant handle.)
|
||||
*
|
||||
* DO NOT CALL THIS FROM DESTRUCTOR
|
||||
*/
|
||||
virtual void Unref() {
|
||||
assert(!persistent().IsEmpty());
|
||||
assert(!persistent().IsWeak());
|
||||
assert(refs_ > 0);
|
||||
if (--refs_ == 0)
|
||||
MakeWeak();
|
||||
}
|
||||
|
||||
int refs_; // ro
|
||||
|
||||
private:
|
||||
NAN_DISALLOW_ASSIGN_COPY_MOVE(ObjectWrap)
|
||||
#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \
|
||||
(V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3))
|
||||
|
||||
static void
|
||||
WeakCallback(v8::WeakCallbackInfo<ObjectWrap> const& info) {
|
||||
ObjectWrap* wrap = info.GetParameter();
|
||||
assert(wrap->refs_ == 0);
|
||||
assert(wrap->handle_.IsNearDeath());
|
||||
wrap->handle_.Reset();
|
||||
delete wrap;
|
||||
}
|
||||
|
||||
#elif NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION
|
||||
|
||||
static void
|
||||
WeakCallback(v8::WeakCallbackData<v8::Object, ObjectWrap> const& data) {
|
||||
ObjectWrap* wrap = data.GetParameter();
|
||||
assert(wrap->refs_ == 0);
|
||||
assert(wrap->handle_.IsNearDeath());
|
||||
wrap->handle_.Reset();
|
||||
delete wrap;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static void WeakCallback(v8::Persistent<v8::Value> value, void *data) {
|
||||
ObjectWrap *wrap = static_cast<ObjectWrap*>(data);
|
||||
assert(wrap->refs_ == 0);
|
||||
assert(wrap->handle_.IsNearDeath());
|
||||
wrap->handle_.Reset();
|
||||
delete wrap;
|
||||
}
|
||||
|
||||
#endif
|
||||
Persistent<v8::Object> handle_;
|
||||
};
|
||||
|
||||
|
||||
#endif // NAN_OBJECT_WRAP_H_
|
||||
129
node_modules/sqlite3/node_modules/nan/nan_persistent_12_inl.h
generated
vendored
Normal file
129
node_modules/sqlite3/node_modules/nan/nan_persistent_12_inl.h
generated
vendored
Normal file
@@ -0,0 +1,129 @@
|
||||
/*********************************************************************
|
||||
* NAN - Native Abstractions for Node.js
|
||||
*
|
||||
* Copyright (c) 2015 NAN contributors
|
||||
*
|
||||
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
|
||||
********************************************************************/
|
||||
|
||||
#ifndef NAN_PERSISTENT_12_INL_H_
|
||||
#define NAN_PERSISTENT_12_INL_H_
|
||||
|
||||
template<typename T, typename M> class Persistent :
|
||||
public v8::Persistent<T, M> {
|
||||
public:
|
||||
NAN_INLINE Persistent() : v8::Persistent<T, M>() {}
|
||||
|
||||
template<typename S> NAN_INLINE Persistent(v8::Local<S> that) :
|
||||
v8::Persistent<T, M>(v8::Isolate::GetCurrent(), that) {}
|
||||
|
||||
template<typename S, typename M2>
|
||||
NAN_INLINE Persistent(const v8::Persistent<S, M2> &that) :
|
||||
v8::Persistent<T, M2>(v8::Isolate::GetCurrent(), that) {}
|
||||
|
||||
NAN_INLINE void Reset() { v8::PersistentBase<T>::Reset(); }
|
||||
|
||||
template <typename S>
|
||||
NAN_INLINE void Reset(const v8::Local<S> &other) {
|
||||
v8::PersistentBase<T>::Reset(v8::Isolate::GetCurrent(), other);
|
||||
}
|
||||
|
||||
template <typename S>
|
||||
NAN_INLINE void Reset(const v8::PersistentBase<S> &other) {
|
||||
v8::PersistentBase<T>::Reset(v8::Isolate::GetCurrent(), other);
|
||||
}
|
||||
|
||||
template<typename P>
|
||||
NAN_INLINE void SetWeak(
|
||||
P *parameter
|
||||
, typename WeakCallbackInfo<P>::Callback callback
|
||||
, WeakCallbackType type);
|
||||
|
||||
private:
|
||||
NAN_INLINE T *operator*() const { return *PersistentBase<T>::persistent; }
|
||||
|
||||
template<typename S, typename M2>
|
||||
NAN_INLINE void Copy(const Persistent<S, M2> &that) {
|
||||
TYPE_CHECK(T, S);
|
||||
|
||||
this->Reset();
|
||||
|
||||
if (!that.IsEmpty()) {
|
||||
this->Reset(that);
|
||||
M::Copy(that, this);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \
|
||||
(V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3))
|
||||
template<typename T>
|
||||
class Global : public v8::Global<T> {
|
||||
public:
|
||||
NAN_INLINE Global() : v8::Global<T>() {}
|
||||
|
||||
template<typename S> NAN_INLINE Global(v8::Local<S> that) :
|
||||
v8::Global<T>(v8::Isolate::GetCurrent(), that) {}
|
||||
|
||||
template<typename S>
|
||||
NAN_INLINE Global(const v8::PersistentBase<S> &that) :
|
||||
v8::Global<S>(v8::Isolate::GetCurrent(), that) {}
|
||||
|
||||
NAN_INLINE void Reset() { v8::PersistentBase<T>::Reset(); }
|
||||
|
||||
template <typename S>
|
||||
NAN_INLINE void Reset(const v8::Local<S> &other) {
|
||||
v8::PersistentBase<T>::Reset(v8::Isolate::GetCurrent(), other);
|
||||
}
|
||||
|
||||
template <typename S>
|
||||
NAN_INLINE void Reset(const v8::PersistentBase<S> &other) {
|
||||
v8::PersistentBase<T>::Reset(v8::Isolate::GetCurrent(), other);
|
||||
}
|
||||
|
||||
template<typename P>
|
||||
NAN_INLINE void SetWeak(
|
||||
P *parameter
|
||||
, typename WeakCallbackInfo<P>::Callback callback
|
||||
, WeakCallbackType type) {
|
||||
reinterpret_cast<Persistent<T>*>(this)->SetWeak(
|
||||
parameter, callback, type);
|
||||
}
|
||||
};
|
||||
#else
|
||||
template<typename T>
|
||||
class Global : public v8::UniquePersistent<T> {
|
||||
public:
|
||||
NAN_INLINE Global() : v8::UniquePersistent<T>() {}
|
||||
|
||||
template<typename S> NAN_INLINE Global(v8::Local<S> that) :
|
||||
v8::UniquePersistent<T>(v8::Isolate::GetCurrent(), that) {}
|
||||
|
||||
template<typename S>
|
||||
NAN_INLINE Global(const v8::PersistentBase<S> &that) :
|
||||
v8::UniquePersistent<S>(v8::Isolate::GetCurrent(), that) {}
|
||||
|
||||
NAN_INLINE void Reset() { v8::PersistentBase<T>::Reset(); }
|
||||
|
||||
template <typename S>
|
||||
NAN_INLINE void Reset(const v8::Local<S> &other) {
|
||||
v8::PersistentBase<T>::Reset(v8::Isolate::GetCurrent(), other);
|
||||
}
|
||||
|
||||
template <typename S>
|
||||
NAN_INLINE void Reset(const v8::PersistentBase<S> &other) {
|
||||
v8::PersistentBase<T>::Reset(v8::Isolate::GetCurrent(), other);
|
||||
}
|
||||
|
||||
template<typename P>
|
||||
NAN_INLINE void SetWeak(
|
||||
P *parameter
|
||||
, typename WeakCallbackInfo<P>::Callback callback
|
||||
, WeakCallbackType type) {
|
||||
reinterpret_cast<Persistent<T>*>(this)->SetWeak(
|
||||
parameter, callback, type);
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif // NAN_PERSISTENT_12_INL_H_
|
||||
238
node_modules/sqlite3/node_modules/nan/nan_persistent_pre_12_inl.h
generated
vendored
Normal file
238
node_modules/sqlite3/node_modules/nan/nan_persistent_pre_12_inl.h
generated
vendored
Normal file
@@ -0,0 +1,238 @@
|
||||
/*********************************************************************
|
||||
* NAN - Native Abstractions for Node.js
|
||||
*
|
||||
* Copyright (c) 2015 NAN contributors
|
||||
*
|
||||
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
|
||||
********************************************************************/
|
||||
|
||||
#ifndef NAN_PERSISTENT_PRE_12_INL_H_
|
||||
#define NAN_PERSISTENT_PRE_12_INL_H_
|
||||
|
||||
template<typename T>
|
||||
class PersistentBase {
|
||||
v8::Persistent<T> persistent;
|
||||
template<typename U, typename M>
|
||||
friend v8::Local<U> New(const Persistent<U, M> &p);
|
||||
template<typename S> friend class ReturnValue;
|
||||
|
||||
public:
|
||||
NAN_INLINE PersistentBase() :
|
||||
persistent() {}
|
||||
|
||||
NAN_INLINE void Reset() {
|
||||
persistent.Dispose();
|
||||
persistent.Clear();
|
||||
}
|
||||
|
||||
template<typename S>
|
||||
NAN_INLINE void Reset(const v8::Local<S> &other) {
|
||||
TYPE_CHECK(T, S);
|
||||
|
||||
if (!persistent.IsEmpty()) {
|
||||
persistent.Dispose();
|
||||
}
|
||||
|
||||
if (other.IsEmpty()) {
|
||||
persistent.Clear();
|
||||
} else {
|
||||
persistent = v8::Persistent<T>::New(other);
|
||||
}
|
||||
}
|
||||
|
||||
template<typename S>
|
||||
NAN_INLINE void Reset(const PersistentBase<S> &other) {
|
||||
TYPE_CHECK(T, S);
|
||||
|
||||
if (!persistent.IsEmpty()) {
|
||||
persistent.Dispose();
|
||||
}
|
||||
|
||||
if (other.IsEmpty()) {
|
||||
persistent.Clear();
|
||||
} else {
|
||||
persistent = v8::Persistent<T>::New(other.persistent);
|
||||
}
|
||||
}
|
||||
|
||||
NAN_INLINE bool IsEmpty() const { return persistent.IsEmpty(); }
|
||||
|
||||
NAN_INLINE void Empty() { persistent.Clear(); }
|
||||
|
||||
template<typename S>
|
||||
NAN_INLINE bool operator==(const PersistentBase<S> &that) {
|
||||
return this->persistent == that.persistent;
|
||||
}
|
||||
|
||||
template<typename S>
|
||||
NAN_INLINE bool operator==(const v8::Local<S> &that) {
|
||||
return this->persistent == that;
|
||||
}
|
||||
|
||||
template<typename S>
|
||||
NAN_INLINE bool operator!=(const PersistentBase<S> &that) {
|
||||
return !operator==(that);
|
||||
}
|
||||
|
||||
template<typename S>
|
||||
NAN_INLINE bool operator!=(const v8::Local<S> &that) {
|
||||
return !operator==(that);
|
||||
}
|
||||
|
||||
template<typename P>
|
||||
NAN_INLINE void SetWeak(
|
||||
P *parameter
|
||||
, typename WeakCallbackInfo<P>::Callback callback
|
||||
, WeakCallbackType type);
|
||||
|
||||
NAN_INLINE void ClearWeak() { persistent.ClearWeak(); }
|
||||
|
||||
NAN_INLINE void MarkIndependent() { persistent.MarkIndependent(); }
|
||||
|
||||
NAN_INLINE bool IsIndependent() const { return persistent.IsIndependent(); }
|
||||
|
||||
NAN_INLINE bool IsNearDeath() const { return persistent.IsNearDeath(); }
|
||||
|
||||
NAN_INLINE bool IsWeak() const { return persistent.IsWeak(); }
|
||||
|
||||
private:
|
||||
NAN_INLINE explicit PersistentBase(v8::Persistent<T> that) :
|
||||
persistent(that) { }
|
||||
NAN_INLINE explicit PersistentBase(T *val) : persistent(val) {}
|
||||
template<typename S, typename M> friend class Persistent;
|
||||
template<typename S> friend class Global;
|
||||
friend class ObjectWrap;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
class NonCopyablePersistentTraits {
|
||||
public:
|
||||
typedef Persistent<T, NonCopyablePersistentTraits<T> >
|
||||
NonCopyablePersistent;
|
||||
static const bool kResetInDestructor = false;
|
||||
template<typename S, typename M>
|
||||
NAN_INLINE static void Copy(const Persistent<S, M> &source,
|
||||
NonCopyablePersistent *dest) {
|
||||
Uncompilable<v8::Object>();
|
||||
}
|
||||
|
||||
template<typename O> NAN_INLINE static void Uncompilable() {
|
||||
TYPE_CHECK(O, v8::Primitive);
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct CopyablePersistentTraits {
|
||||
typedef Persistent<T, CopyablePersistentTraits<T> > CopyablePersistent;
|
||||
static const bool kResetInDestructor = true;
|
||||
template<typename S, typename M>
|
||||
static NAN_INLINE void Copy(const Persistent<S, M> &source,
|
||||
CopyablePersistent *dest) {}
|
||||
};
|
||||
|
||||
template<typename T, typename M> class Persistent :
|
||||
public PersistentBase<T> {
|
||||
public:
|
||||
NAN_INLINE Persistent() {}
|
||||
|
||||
template<typename S> NAN_INLINE Persistent(v8::Handle<S> that)
|
||||
: PersistentBase<T>(v8::Persistent<T>::New(that)) {
|
||||
TYPE_CHECK(T, S);
|
||||
}
|
||||
|
||||
NAN_INLINE Persistent(const Persistent &that) : PersistentBase<T>() {
|
||||
Copy(that);
|
||||
}
|
||||
|
||||
template<typename S, typename M2>
|
||||
NAN_INLINE Persistent(const Persistent<S, M2> &that) :
|
||||
PersistentBase<T>() {
|
||||
Copy(that);
|
||||
}
|
||||
|
||||
NAN_INLINE Persistent &operator=(const Persistent &that) {
|
||||
Copy(that);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <class S, class M2>
|
||||
NAN_INLINE Persistent &operator=(const Persistent<S, M2> &that) {
|
||||
Copy(that);
|
||||
return *this;
|
||||
}
|
||||
|
||||
NAN_INLINE ~Persistent() {
|
||||
if (M::kResetInDestructor) this->Reset();
|
||||
}
|
||||
|
||||
private:
|
||||
NAN_INLINE T *operator*() const { return *PersistentBase<T>::persistent; }
|
||||
|
||||
template<typename S, typename M2>
|
||||
NAN_INLINE void Copy(const Persistent<S, M2> &that) {
|
||||
TYPE_CHECK(T, S);
|
||||
|
||||
this->Reset();
|
||||
|
||||
if (!that.IsEmpty()) {
|
||||
this->persistent = v8::Persistent<T>::New(that.persistent);
|
||||
M::Copy(that, this);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
class Global : public PersistentBase<T> {
|
||||
struct RValue {
|
||||
NAN_INLINE explicit RValue(Global* obj) : object(obj) {}
|
||||
Global* object;
|
||||
};
|
||||
|
||||
public:
|
||||
NAN_INLINE Global() : PersistentBase<T>(0) { }
|
||||
|
||||
template <typename S>
|
||||
NAN_INLINE Global(v8::Local<S> that)
|
||||
: PersistentBase<T>(v8::Persistent<T>::New(that)) {
|
||||
TYPE_CHECK(T, S);
|
||||
}
|
||||
|
||||
template <typename S>
|
||||
NAN_INLINE Global(const PersistentBase<S> &that)
|
||||
: PersistentBase<T>(that) {
|
||||
TYPE_CHECK(T, S);
|
||||
}
|
||||
/**
|
||||
* Move constructor.
|
||||
*/
|
||||
NAN_INLINE Global(RValue rvalue)
|
||||
: PersistentBase<T>(rvalue.object.persistent) {
|
||||
rvalue.object->Reset();
|
||||
}
|
||||
NAN_INLINE ~Global() { this->Reset(); }
|
||||
/**
|
||||
* Move via assignment.
|
||||
*/
|
||||
template<typename S>
|
||||
NAN_INLINE Global &operator=(Global<S> rhs) {
|
||||
TYPE_CHECK(T, S);
|
||||
this->Reset(rhs.persistent);
|
||||
rhs.Reset();
|
||||
return *this;
|
||||
}
|
||||
/**
|
||||
* Cast operator for moves.
|
||||
*/
|
||||
NAN_INLINE operator RValue() { return RValue(this); }
|
||||
/**
|
||||
* Pass allows returning uniques from functions, etc.
|
||||
*/
|
||||
Global Pass() { return Global(RValue(this)); }
|
||||
|
||||
private:
|
||||
Global(Global &);
|
||||
void operator=(Global &);
|
||||
template<typename S> friend class ReturnValue;
|
||||
};
|
||||
|
||||
#endif // NAN_PERSISTENT_PRE_12_INL_H_
|
||||
305
node_modules/sqlite3/node_modules/nan/nan_string_bytes.h
generated
vendored
Normal file
305
node_modules/sqlite3/node_modules/nan/nan_string_bytes.h
generated
vendored
Normal file
@@ -0,0 +1,305 @@
|
||||
// Copyright Joyent, Inc. and other Node contributors.
|
||||
//
|
||||
// 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.
|
||||
|
||||
#ifndef NAN_STRING_BYTES_H_
|
||||
#define NAN_STRING_BYTES_H_
|
||||
|
||||
// Decodes a v8::Local<v8::String> or Buffer to a raw char*
|
||||
|
||||
namespace imp {
|
||||
|
||||
using v8::Local;
|
||||
using v8::Object;
|
||||
using v8::String;
|
||||
using v8::Value;
|
||||
|
||||
|
||||
//// Base 64 ////
|
||||
|
||||
#define base64_encoded_size(size) ((size + 2 - ((size + 2) % 3)) / 3 * 4)
|
||||
|
||||
|
||||
|
||||
//// HEX ////
|
||||
|
||||
static bool contains_non_ascii_slow(const char* buf, size_t len) {
|
||||
for (size_t i = 0; i < len; ++i) {
|
||||
if (buf[i] & 0x80) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
static bool contains_non_ascii(const char* src, size_t len) {
|
||||
if (len < 16) {
|
||||
return contains_non_ascii_slow(src, len);
|
||||
}
|
||||
|
||||
const unsigned bytes_per_word = sizeof(void*);
|
||||
const unsigned align_mask = bytes_per_word - 1;
|
||||
const unsigned unaligned = reinterpret_cast<uintptr_t>(src) & align_mask;
|
||||
|
||||
if (unaligned > 0) {
|
||||
const unsigned n = bytes_per_word - unaligned;
|
||||
if (contains_non_ascii_slow(src, n)) return true;
|
||||
src += n;
|
||||
len -= n;
|
||||
}
|
||||
|
||||
|
||||
#if defined(__x86_64__) || defined(_WIN64)
|
||||
const uintptr_t mask = 0x8080808080808080ll;
|
||||
#else
|
||||
const uintptr_t mask = 0x80808080l;
|
||||
#endif
|
||||
|
||||
const uintptr_t* srcw = reinterpret_cast<const uintptr_t*>(src);
|
||||
|
||||
for (size_t i = 0, n = len / bytes_per_word; i < n; ++i) {
|
||||
if (srcw[i] & mask) return true;
|
||||
}
|
||||
|
||||
const unsigned remainder = len & align_mask;
|
||||
if (remainder > 0) {
|
||||
const size_t offset = len - remainder;
|
||||
if (contains_non_ascii_slow(src + offset, remainder)) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
static void force_ascii_slow(const char* src, char* dst, size_t len) {
|
||||
for (size_t i = 0; i < len; ++i) {
|
||||
dst[i] = src[i] & 0x7f;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void force_ascii(const char* src, char* dst, size_t len) {
|
||||
if (len < 16) {
|
||||
force_ascii_slow(src, dst, len);
|
||||
return;
|
||||
}
|
||||
|
||||
const unsigned bytes_per_word = sizeof(void*);
|
||||
const unsigned align_mask = bytes_per_word - 1;
|
||||
const unsigned src_unalign = reinterpret_cast<uintptr_t>(src) & align_mask;
|
||||
const unsigned dst_unalign = reinterpret_cast<uintptr_t>(dst) & align_mask;
|
||||
|
||||
if (src_unalign > 0) {
|
||||
if (src_unalign == dst_unalign) {
|
||||
const unsigned unalign = bytes_per_word - src_unalign;
|
||||
force_ascii_slow(src, dst, unalign);
|
||||
src += unalign;
|
||||
dst += unalign;
|
||||
len -= src_unalign;
|
||||
} else {
|
||||
force_ascii_slow(src, dst, len);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(__x86_64__) || defined(_WIN64)
|
||||
const uintptr_t mask = ~0x8080808080808080ll;
|
||||
#else
|
||||
const uintptr_t mask = ~0x80808080l;
|
||||
#endif
|
||||
|
||||
const uintptr_t* srcw = reinterpret_cast<const uintptr_t*>(src);
|
||||
uintptr_t* dstw = reinterpret_cast<uintptr_t*>(dst);
|
||||
|
||||
for (size_t i = 0, n = len / bytes_per_word; i < n; ++i) {
|
||||
dstw[i] = srcw[i] & mask;
|
||||
}
|
||||
|
||||
const unsigned remainder = len & align_mask;
|
||||
if (remainder > 0) {
|
||||
const size_t offset = len - remainder;
|
||||
force_ascii_slow(src + offset, dst + offset, remainder);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static size_t base64_encode(const char* src,
|
||||
size_t slen,
|
||||
char* dst,
|
||||
size_t dlen) {
|
||||
// We know how much we'll write, just make sure that there's space.
|
||||
assert(dlen >= base64_encoded_size(slen) &&
|
||||
"not enough space provided for base64 encode");
|
||||
|
||||
dlen = base64_encoded_size(slen);
|
||||
|
||||
unsigned a;
|
||||
unsigned b;
|
||||
unsigned c;
|
||||
unsigned i;
|
||||
unsigned k;
|
||||
unsigned n;
|
||||
|
||||
static const char table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
"abcdefghijklmnopqrstuvwxyz"
|
||||
"0123456789+/";
|
||||
|
||||
i = 0;
|
||||
k = 0;
|
||||
n = slen / 3 * 3;
|
||||
|
||||
while (i < n) {
|
||||
a = src[i + 0] & 0xff;
|
||||
b = src[i + 1] & 0xff;
|
||||
c = src[i + 2] & 0xff;
|
||||
|
||||
dst[k + 0] = table[a >> 2];
|
||||
dst[k + 1] = table[((a & 3) << 4) | (b >> 4)];
|
||||
dst[k + 2] = table[((b & 0x0f) << 2) | (c >> 6)];
|
||||
dst[k + 3] = table[c & 0x3f];
|
||||
|
||||
i += 3;
|
||||
k += 4;
|
||||
}
|
||||
|
||||
if (n != slen) {
|
||||
switch (slen - n) {
|
||||
case 1:
|
||||
a = src[i + 0] & 0xff;
|
||||
dst[k + 0] = table[a >> 2];
|
||||
dst[k + 1] = table[(a & 3) << 4];
|
||||
dst[k + 2] = '=';
|
||||
dst[k + 3] = '=';
|
||||
break;
|
||||
|
||||
case 2:
|
||||
a = src[i + 0] & 0xff;
|
||||
b = src[i + 1] & 0xff;
|
||||
dst[k + 0] = table[a >> 2];
|
||||
dst[k + 1] = table[((a & 3) << 4) | (b >> 4)];
|
||||
dst[k + 2] = table[(b & 0x0f) << 2];
|
||||
dst[k + 3] = '=';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return dlen;
|
||||
}
|
||||
|
||||
|
||||
static size_t hex_encode(const char* src, size_t slen, char* dst, size_t dlen) {
|
||||
// We know how much we'll write, just make sure that there's space.
|
||||
assert(dlen >= slen * 2 &&
|
||||
"not enough space provided for hex encode");
|
||||
|
||||
dlen = slen * 2;
|
||||
for (uint32_t i = 0, k = 0; k < dlen; i += 1, k += 2) {
|
||||
static const char hex[] = "0123456789abcdef";
|
||||
uint8_t val = static_cast<uint8_t>(src[i]);
|
||||
dst[k + 0] = hex[val >> 4];
|
||||
dst[k + 1] = hex[val & 15];
|
||||
}
|
||||
|
||||
return dlen;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static Local<Value> Encode(const char* buf,
|
||||
size_t buflen,
|
||||
enum Encoding encoding) {
|
||||
assert(buflen <= node::Buffer::kMaxLength);
|
||||
if (!buflen && encoding != BUFFER)
|
||||
return New("").ToLocalChecked();
|
||||
|
||||
Local<String> val;
|
||||
switch (encoding) {
|
||||
case BUFFER:
|
||||
return CopyBuffer(buf, buflen).ToLocalChecked();
|
||||
|
||||
case ASCII:
|
||||
if (contains_non_ascii(buf, buflen)) {
|
||||
char* out = new char[buflen];
|
||||
force_ascii(buf, out, buflen);
|
||||
val = New<String>(out, buflen).ToLocalChecked();
|
||||
delete[] out;
|
||||
} else {
|
||||
val = New<String>(buf, buflen).ToLocalChecked();
|
||||
}
|
||||
break;
|
||||
|
||||
case UTF8:
|
||||
val = New<String>(buf, buflen).ToLocalChecked();
|
||||
break;
|
||||
|
||||
case BINARY: {
|
||||
// TODO(isaacs) use ExternalTwoByteString?
|
||||
const unsigned char *cbuf = reinterpret_cast<const unsigned char*>(buf);
|
||||
uint16_t * twobytebuf = new uint16_t[buflen];
|
||||
for (size_t i = 0; i < buflen; i++) {
|
||||
// XXX is the following line platform independent?
|
||||
twobytebuf[i] = cbuf[i];
|
||||
}
|
||||
val = New<String>(twobytebuf, buflen).ToLocalChecked();
|
||||
delete[] twobytebuf;
|
||||
break;
|
||||
}
|
||||
|
||||
case BASE64: {
|
||||
size_t dlen = base64_encoded_size(buflen);
|
||||
char* dst = new char[dlen];
|
||||
|
||||
size_t written = base64_encode(buf, buflen, dst, dlen);
|
||||
assert(written == dlen);
|
||||
|
||||
val = New<String>(dst, dlen).ToLocalChecked();
|
||||
delete[] dst;
|
||||
break;
|
||||
}
|
||||
|
||||
case UCS2: {
|
||||
const uint16_t* data = reinterpret_cast<const uint16_t*>(buf);
|
||||
val = New<String>(data, buflen / 2).ToLocalChecked();
|
||||
break;
|
||||
}
|
||||
|
||||
case HEX: {
|
||||
size_t dlen = buflen * 2;
|
||||
char* dst = new char[dlen];
|
||||
size_t written = hex_encode(buf, buflen, dst, dlen);
|
||||
assert(written == dlen);
|
||||
|
||||
val = New<String>(dst, dlen).ToLocalChecked();
|
||||
delete[] dst;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
assert(0 && "unknown encoding");
|
||||
break;
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
#undef base64_encoded_size
|
||||
|
||||
} // end of namespace imp
|
||||
|
||||
#endif // NAN_STRING_BYTES_H_
|
||||
422
node_modules/sqlite3/node_modules/nan/nan_weak.h
generated
vendored
Normal file
422
node_modules/sqlite3/node_modules/nan/nan_weak.h
generated
vendored
Normal file
@@ -0,0 +1,422 @@
|
||||
/*********************************************************************
|
||||
* NAN - Native Abstractions for Node.js
|
||||
*
|
||||
* Copyright (c) 2015 NAN contributors
|
||||
*
|
||||
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
|
||||
********************************************************************/
|
||||
|
||||
#ifndef NAN_WEAK_H_
|
||||
#define NAN_WEAK_H_
|
||||
|
||||
static const int kInternalFieldsInWeakCallback = 2;
|
||||
static const int kNoInternalFieldIndex = -1;
|
||||
|
||||
#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \
|
||||
(V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3))
|
||||
# define NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ \
|
||||
v8::WeakCallbackInfo<WeakCallbackInfo<T> > const&
|
||||
# define NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_ \
|
||||
NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_
|
||||
# define NAN_WEAK_PARAMETER_CALLBACK_SIG_ NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_
|
||||
# define NAN_WEAK_TWOFIELD_CALLBACK_SIG_ NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_
|
||||
#elif NODE_MODULE_VERSION > IOJS_1_1_MODULE_VERSION
|
||||
# define NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ \
|
||||
v8::PhantomCallbackData<WeakCallbackInfo<T> > const&
|
||||
# define NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_ \
|
||||
NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_
|
||||
# define NAN_WEAK_PARAMETER_CALLBACK_SIG_ NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_
|
||||
# define NAN_WEAK_TWOFIELD_CALLBACK_SIG_ NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_
|
||||
#elif NODE_MODULE_VERSION > NODE_0_12_MODULE_VERSION
|
||||
# define NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ \
|
||||
v8::PhantomCallbackData<WeakCallbackInfo<T> > const&
|
||||
# define NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_ \
|
||||
v8::InternalFieldsCallbackData<WeakCallbackInfo<T>, void> const&
|
||||
# define NAN_WEAK_PARAMETER_CALLBACK_SIG_ NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_
|
||||
# define NAN_WEAK_TWOFIELD_CALLBACK_SIG_ NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_
|
||||
#elif NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION
|
||||
# define NAN_WEAK_CALLBACK_DATA_TYPE_ \
|
||||
v8::WeakCallbackData<S, WeakCallbackInfo<T> > const&
|
||||
# define NAN_WEAK_CALLBACK_SIG_ NAN_WEAK_CALLBACK_DATA_TYPE_
|
||||
#else
|
||||
# define NAN_WEAK_CALLBACK_DATA_TYPE_ void *
|
||||
# define NAN_WEAK_CALLBACK_SIG_ \
|
||||
v8::Persistent<v8::Value>, NAN_WEAK_CALLBACK_DATA_TYPE_
|
||||
#endif
|
||||
|
||||
template<typename T>
|
||||
class WeakCallbackInfo {
|
||||
public:
|
||||
typedef void (*Callback)(const WeakCallbackInfo<T>& data);
|
||||
WeakCallbackInfo(
|
||||
Persistent<v8::Value> *persistent
|
||||
, Callback callback
|
||||
, void *parameter
|
||||
, void *field1 = 0
|
||||
, void *field2 = 0) :
|
||||
callback_(callback), isolate_(0), parameter_(parameter) {
|
||||
std::memcpy(&persistent_, persistent, sizeof (v8::Persistent<v8::Value>));
|
||||
internal_fields_[0] = field1;
|
||||
internal_fields_[1] = field2;
|
||||
}
|
||||
NAN_INLINE v8::Isolate *GetIsolate() const { return isolate_; }
|
||||
NAN_INLINE T *GetParameter() const { return static_cast<T*>(parameter_); }
|
||||
NAN_INLINE void *GetInternalField(int index) const {
|
||||
assert((index == 0 || index == 1) && "internal field index out of bounds");
|
||||
if (index == 0) {
|
||||
return internal_fields_[0];
|
||||
} else {
|
||||
return internal_fields_[1];
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
NAN_DISALLOW_ASSIGN_COPY_MOVE(WeakCallbackInfo)
|
||||
Callback callback_;
|
||||
v8::Isolate *isolate_;
|
||||
void *parameter_;
|
||||
void *internal_fields_[kInternalFieldsInWeakCallback];
|
||||
v8::Persistent<v8::Value> persistent_;
|
||||
template<typename S, typename M> friend class Persistent;
|
||||
template<typename S> friend class PersistentBase;
|
||||
#if NODE_MODULE_VERSION <= NODE_0_12_MODULE_VERSION
|
||||
# if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION
|
||||
template<typename S>
|
||||
static void invoke(NAN_WEAK_CALLBACK_SIG_ data);
|
||||
template<typename S>
|
||||
static WeakCallbackInfo *unwrap(NAN_WEAK_CALLBACK_DATA_TYPE_ data);
|
||||
# else
|
||||
static void invoke(NAN_WEAK_CALLBACK_SIG_ data);
|
||||
static WeakCallbackInfo *unwrap(NAN_WEAK_CALLBACK_DATA_TYPE_ data);
|
||||
# endif
|
||||
#else
|
||||
static void invokeparameter(NAN_WEAK_PARAMETER_CALLBACK_SIG_ data);
|
||||
static void invoketwofield(NAN_WEAK_TWOFIELD_CALLBACK_SIG_ data);
|
||||
static WeakCallbackInfo *unwrapparameter(
|
||||
NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ data);
|
||||
static WeakCallbackInfo *unwraptwofield(
|
||||
NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_ data);
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \
|
||||
(V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3))
|
||||
|
||||
template<typename T>
|
||||
void
|
||||
WeakCallbackInfo<T>::invokeparameter(NAN_WEAK_PARAMETER_CALLBACK_SIG_ data) {
|
||||
WeakCallbackInfo<T> *cbinfo = unwrapparameter(data);
|
||||
if (data.IsFirstPass()) {
|
||||
cbinfo->persistent_.Reset();
|
||||
data.SetSecondPassCallback(invokeparameter);
|
||||
} else {
|
||||
cbinfo->callback_(*cbinfo);
|
||||
delete cbinfo;
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void
|
||||
WeakCallbackInfo<T>::invoketwofield(NAN_WEAK_TWOFIELD_CALLBACK_SIG_ data) {
|
||||
WeakCallbackInfo<T> *cbinfo = unwraptwofield(data);
|
||||
if (data.IsFirstPass()) {
|
||||
cbinfo->persistent_.Reset();
|
||||
data.SetSecondPassCallback(invoketwofield);
|
||||
} else {
|
||||
cbinfo->callback_(*cbinfo);
|
||||
delete cbinfo;
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
WeakCallbackInfo<T> *WeakCallbackInfo<T>::unwrapparameter(
|
||||
NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ data) {
|
||||
WeakCallbackInfo<T> *cbinfo =
|
||||
static_cast<WeakCallbackInfo<T>*>(data.GetParameter());
|
||||
cbinfo->isolate_ = data.GetIsolate();
|
||||
return cbinfo;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
WeakCallbackInfo<T> *WeakCallbackInfo<T>::unwraptwofield(
|
||||
NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_ data) {
|
||||
WeakCallbackInfo<T> *cbinfo =
|
||||
static_cast<WeakCallbackInfo<T>*>(data.GetInternalField(0));
|
||||
cbinfo->isolate_ = data.GetIsolate();
|
||||
return cbinfo;
|
||||
}
|
||||
|
||||
#undef NAN_WEAK_PARAMETER_CALLBACK_SIG_
|
||||
#undef NAN_WEAK_TWOFIELD_CALLBACK_SIG_
|
||||
#undef NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_
|
||||
#undef NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_
|
||||
# elif NODE_MODULE_VERSION > NODE_0_12_MODULE_VERSION
|
||||
|
||||
template<typename T>
|
||||
void
|
||||
WeakCallbackInfo<T>::invokeparameter(NAN_WEAK_PARAMETER_CALLBACK_SIG_ data) {
|
||||
WeakCallbackInfo<T> *cbinfo = unwrapparameter(data);
|
||||
cbinfo->persistent_.Reset();
|
||||
cbinfo->callback_(*cbinfo);
|
||||
delete cbinfo;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void
|
||||
WeakCallbackInfo<T>::invoketwofield(NAN_WEAK_TWOFIELD_CALLBACK_SIG_ data) {
|
||||
WeakCallbackInfo<T> *cbinfo = unwraptwofield(data);
|
||||
cbinfo->persistent_.Reset();
|
||||
cbinfo->callback_(*cbinfo);
|
||||
delete cbinfo;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
WeakCallbackInfo<T> *WeakCallbackInfo<T>::unwrapparameter(
|
||||
NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ data) {
|
||||
WeakCallbackInfo<T> *cbinfo =
|
||||
static_cast<WeakCallbackInfo<T>*>(data.GetParameter());
|
||||
cbinfo->isolate_ = data.GetIsolate();
|
||||
return cbinfo;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
WeakCallbackInfo<T> *WeakCallbackInfo<T>::unwraptwofield(
|
||||
NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_ data) {
|
||||
WeakCallbackInfo<T> *cbinfo =
|
||||
static_cast<WeakCallbackInfo<T>*>(data.GetInternalField1());
|
||||
cbinfo->isolate_ = data.GetIsolate();
|
||||
return cbinfo;
|
||||
}
|
||||
|
||||
#undef NAN_WEAK_PARAMETER_CALLBACK_SIG_
|
||||
#undef NAN_WEAK_TWOFIELD_CALLBACK_SIG_
|
||||
#undef NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_
|
||||
#undef NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_
|
||||
#elif NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION
|
||||
|
||||
template<typename T>
|
||||
template<typename S>
|
||||
void WeakCallbackInfo<T>::invoke(NAN_WEAK_CALLBACK_SIG_ data) {
|
||||
WeakCallbackInfo<T> *cbinfo = unwrap(data);
|
||||
cbinfo->persistent_.Reset();
|
||||
cbinfo->callback_(*cbinfo);
|
||||
delete cbinfo;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
template<typename S>
|
||||
WeakCallbackInfo<T> *WeakCallbackInfo<T>::unwrap(
|
||||
NAN_WEAK_CALLBACK_DATA_TYPE_ data) {
|
||||
void *parameter = data.GetParameter();
|
||||
WeakCallbackInfo<T> *cbinfo =
|
||||
static_cast<WeakCallbackInfo<T>*>(parameter);
|
||||
cbinfo->isolate_ = data.GetIsolate();
|
||||
return cbinfo;
|
||||
}
|
||||
|
||||
#undef NAN_WEAK_CALLBACK_SIG_
|
||||
#undef NAN_WEAK_CALLBACK_DATA_TYPE_
|
||||
#else
|
||||
|
||||
template<typename T>
|
||||
void WeakCallbackInfo<T>::invoke(NAN_WEAK_CALLBACK_SIG_ data) {
|
||||
WeakCallbackInfo<T> *cbinfo = unwrap(data);
|
||||
cbinfo->persistent_.Dispose();
|
||||
cbinfo->persistent_.Clear();
|
||||
cbinfo->callback_(*cbinfo);
|
||||
delete cbinfo;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
WeakCallbackInfo<T> *WeakCallbackInfo<T>::unwrap(
|
||||
NAN_WEAK_CALLBACK_DATA_TYPE_ data) {
|
||||
WeakCallbackInfo<T> *cbinfo =
|
||||
static_cast<WeakCallbackInfo<T>*>(data);
|
||||
cbinfo->isolate_ = v8::Isolate::GetCurrent();
|
||||
return cbinfo;
|
||||
}
|
||||
|
||||
#undef NAN_WEAK_CALLBACK_SIG_
|
||||
#undef NAN_WEAK_CALLBACK_DATA_TYPE_
|
||||
#endif
|
||||
|
||||
#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \
|
||||
(V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3))
|
||||
template<typename T, typename M>
|
||||
template<typename P>
|
||||
NAN_INLINE void Persistent<T, M>::SetWeak(
|
||||
P *parameter
|
||||
, typename WeakCallbackInfo<P>::Callback callback
|
||||
, WeakCallbackType type) {
|
||||
WeakCallbackInfo<P> *wcbd;
|
||||
if (type == WeakCallbackType::kParameter) {
|
||||
wcbd = new WeakCallbackInfo<P>(
|
||||
reinterpret_cast<Persistent<v8::Value>*>(this)
|
||||
, callback
|
||||
, parameter);
|
||||
v8::PersistentBase<T>::SetWeak(
|
||||
wcbd
|
||||
, WeakCallbackInfo<P>::invokeparameter
|
||||
, type);
|
||||
} else {
|
||||
v8::Local<T>* self = reinterpret_cast<v8::Local<T>*>(this);
|
||||
assert((*self)->IsObject());
|
||||
int count = (*self)->InternalFieldCount();
|
||||
void *internal_fields[kInternalFieldsInWeakCallback] = {0, 0};
|
||||
for (int i = 0; i < count && i < kInternalFieldsInWeakCallback; i++) {
|
||||
internal_fields[i] = (*self)->GetAlignedPointerFromInternalField(i);
|
||||
}
|
||||
wcbd = new WeakCallbackInfo<P>(
|
||||
reinterpret_cast<Persistent<v8::Value>*>(this)
|
||||
, callback
|
||||
, 0
|
||||
, internal_fields[0]
|
||||
, internal_fields[1]);
|
||||
(*self)->SetAlignedPointerInInternalField(0, wcbd);
|
||||
v8::PersistentBase<T>::SetWeak(
|
||||
static_cast<WeakCallbackInfo<P>*>(0)
|
||||
, WeakCallbackInfo<P>::invoketwofield
|
||||
, type);
|
||||
}
|
||||
}
|
||||
#elif NODE_MODULE_VERSION > IOJS_1_1_MODULE_VERSION
|
||||
template<typename T, typename M>
|
||||
template<typename P>
|
||||
NAN_INLINE void Persistent<T, M>::SetWeak(
|
||||
P *parameter
|
||||
, typename WeakCallbackInfo<P>::Callback callback
|
||||
, WeakCallbackType type) {
|
||||
WeakCallbackInfo<P> *wcbd;
|
||||
if (type == WeakCallbackType::kParameter) {
|
||||
wcbd = new WeakCallbackInfo<P>(
|
||||
reinterpret_cast<Persistent<v8::Value>*>(this)
|
||||
, callback
|
||||
, parameter);
|
||||
v8::PersistentBase<T>::SetPhantom(
|
||||
wcbd
|
||||
, WeakCallbackInfo<P>::invokeparameter);
|
||||
} else {
|
||||
v8::Local<T>* self = reinterpret_cast<v8::Local<T>*>(this);
|
||||
assert((*self)->IsObject());
|
||||
int count = (*self)->InternalFieldCount();
|
||||
void *internal_fields[kInternalFieldsInWeakCallback] = {0, 0};
|
||||
for (int i = 0; i < count && i < kInternalFieldsInWeakCallback; i++) {
|
||||
internal_fields[i] = (*self)->GetAlignedPointerFromInternalField(i);
|
||||
}
|
||||
wcbd = new WeakCallbackInfo<P>(
|
||||
reinterpret_cast<Persistent<v8::Value>*>(this)
|
||||
, callback
|
||||
, 0
|
||||
, internal_fields[0]
|
||||
, internal_fields[1]);
|
||||
(*self)->SetAlignedPointerInInternalField(0, wcbd);
|
||||
v8::PersistentBase<T>::SetPhantom(
|
||||
static_cast<WeakCallbackInfo<P>*>(0)
|
||||
, WeakCallbackInfo<P>::invoketwofield
|
||||
, 0
|
||||
, count > 1 ? 1 : kNoInternalFieldIndex);
|
||||
}
|
||||
}
|
||||
#elif NODE_MODULE_VERSION > NODE_0_12_MODULE_VERSION
|
||||
template<typename T, typename M>
|
||||
template<typename P>
|
||||
NAN_INLINE void Persistent<T, M>::SetWeak(
|
||||
P *parameter
|
||||
, typename WeakCallbackInfo<P>::Callback callback
|
||||
, WeakCallbackType type) {
|
||||
WeakCallbackInfo<P> *wcbd;
|
||||
if (type == WeakCallbackType::kParameter) {
|
||||
wcbd = new WeakCallbackInfo<P>(
|
||||
reinterpret_cast<Persistent<v8::Value>*>(this)
|
||||
, callback
|
||||
, parameter);
|
||||
v8::PersistentBase<T>::SetPhantom(
|
||||
wcbd
|
||||
, WeakCallbackInfo<P>::invokeparameter);
|
||||
} else {
|
||||
v8::Local<T>* self = reinterpret_cast<v8::Local<T>*>(this);
|
||||
assert((*self)->IsObject());
|
||||
int count = (*self)->InternalFieldCount();
|
||||
void *internal_fields[kInternalFieldsInWeakCallback] = {0, 0};
|
||||
for (int i = 0; i < count && i < kInternalFieldsInWeakCallback; i++) {
|
||||
internal_fields[i] = (*self)->GetAlignedPointerFromInternalField(i);
|
||||
}
|
||||
wcbd = new WeakCallbackInfo<P>(
|
||||
reinterpret_cast<Persistent<v8::Value>*>(this)
|
||||
, callback
|
||||
, 0
|
||||
, internal_fields[0]
|
||||
, internal_fields[1]);
|
||||
(*self)->SetAlignedPointerInInternalField(0, wcbd);
|
||||
v8::PersistentBase<T>::SetPhantom(
|
||||
WeakCallbackInfo<P>::invoketwofield
|
||||
, 0
|
||||
, count > 1 ? 1 : kNoInternalFieldIndex);
|
||||
}
|
||||
}
|
||||
#elif NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION
|
||||
template<typename T, typename M>
|
||||
template<typename P>
|
||||
NAN_INLINE void Persistent<T, M>::SetWeak(
|
||||
P *parameter
|
||||
, typename WeakCallbackInfo<P>::Callback callback
|
||||
, WeakCallbackType type) {
|
||||
WeakCallbackInfo<P> *wcbd;
|
||||
if (type == WeakCallbackType::kParameter) {
|
||||
wcbd = new WeakCallbackInfo<P>(
|
||||
reinterpret_cast<Persistent<v8::Value>*>(this)
|
||||
, callback
|
||||
, parameter);
|
||||
v8::PersistentBase<T>::SetWeak(wcbd, WeakCallbackInfo<P>::invoke);
|
||||
} else {
|
||||
v8::Local<T>* self = reinterpret_cast<v8::Local<T>*>(this);
|
||||
assert((*self)->IsObject());
|
||||
int count = (*self)->InternalFieldCount();
|
||||
void *internal_fields[kInternalFieldsInWeakCallback] = {0, 0};
|
||||
for (int i = 0; i < count && i < kInternalFieldsInWeakCallback; i++) {
|
||||
internal_fields[i] = (*self)->GetAlignedPointerFromInternalField(i);
|
||||
}
|
||||
wcbd = new WeakCallbackInfo<P>(
|
||||
reinterpret_cast<Persistent<v8::Value>*>(this)
|
||||
, callback
|
||||
, 0
|
||||
, internal_fields[0]
|
||||
, internal_fields[1]);
|
||||
v8::PersistentBase<T>::SetWeak(wcbd, WeakCallbackInfo<P>::invoke);
|
||||
}
|
||||
}
|
||||
#else
|
||||
template<typename T>
|
||||
template<typename P>
|
||||
NAN_INLINE void PersistentBase<T>::SetWeak(
|
||||
P *parameter
|
||||
, typename WeakCallbackInfo<P>::Callback callback
|
||||
, WeakCallbackType type) {
|
||||
WeakCallbackInfo<P> *wcbd;
|
||||
if (type == WeakCallbackType::kParameter) {
|
||||
wcbd = new WeakCallbackInfo<P>(
|
||||
reinterpret_cast<Persistent<v8::Value>*>(this)
|
||||
, callback
|
||||
, parameter);
|
||||
persistent.MakeWeak(wcbd, WeakCallbackInfo<P>::invoke);
|
||||
} else {
|
||||
v8::Local<T>* self = reinterpret_cast<v8::Local<T>*>(this);
|
||||
assert((*self)->IsObject());
|
||||
int count = (*self)->InternalFieldCount();
|
||||
void *internal_fields[kInternalFieldsInWeakCallback] = {0, 0};
|
||||
for (int i = 0; i < count && i < kInternalFieldsInWeakCallback; i++) {
|
||||
internal_fields[i] = (*self)->GetPointerFromInternalField(i);
|
||||
}
|
||||
wcbd = new WeakCallbackInfo<P>(
|
||||
reinterpret_cast<Persistent<v8::Value>*>(this)
|
||||
, callback
|
||||
, 0
|
||||
, internal_fields[0]
|
||||
, internal_fields[1]);
|
||||
persistent.MakeWeak(wcbd, WeakCallbackInfo<P>::invoke);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // NAN_WEAK_H_
|
||||
92
node_modules/sqlite3/node_modules/nan/package.json
generated
vendored
Normal file
92
node_modules/sqlite3/node_modules/nan/package.json
generated
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
{
|
||||
"name": "nan",
|
||||
"version": "2.0.9",
|
||||
"description": "Native Abstractions for Node.js: C++ header for Node 0.8 -> 4 compatibility",
|
||||
"main": "include_dirs.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/nodejs/nan.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "tap --gc test/js/*-test.js",
|
||||
"rebuild-tests": "pangyp rebuild --msvs_version=2013 --directory test",
|
||||
"docs": "doc/.build.sh"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Rod Vagg",
|
||||
"email": "r@va.gg",
|
||||
"url": "https://github.com/rvagg"
|
||||
},
|
||||
{
|
||||
"name": "Benjamin Byholm",
|
||||
"email": "bbyholm@abo.fi",
|
||||
"url": "https://github.com/kkoopa/"
|
||||
},
|
||||
{
|
||||
"name": "Trevor Norris",
|
||||
"email": "trev.norris@gmail.com",
|
||||
"url": "https://github.com/trevnorris"
|
||||
},
|
||||
{
|
||||
"name": "Nathan Rajlich",
|
||||
"email": "nathan@tootallnate.net",
|
||||
"url": "https://github.com/TooTallNate"
|
||||
},
|
||||
{
|
||||
"name": "Brett Lawson",
|
||||
"email": "brett19@gmail.com",
|
||||
"url": "https://github.com/brett19"
|
||||
},
|
||||
{
|
||||
"name": "Ben Noordhuis",
|
||||
"email": "info@bnoordhuis.nl",
|
||||
"url": "https://github.com/bnoordhuis"
|
||||
},
|
||||
{
|
||||
"name": "David Siegel",
|
||||
"email": "david@artcom.de",
|
||||
"url": "https://github.com/agnat"
|
||||
}
|
||||
],
|
||||
"devDependencies": {
|
||||
"bindings": "~1.2.1",
|
||||
"commander": "^2.8.1",
|
||||
"glob": "^5.0.14",
|
||||
"node-gyp": "~2.0.2",
|
||||
"pangyp": "~2.2.0",
|
||||
"tap": "~0.7.1",
|
||||
"xtend": "~4.0.0"
|
||||
},
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/nodejs/nan/issues"
|
||||
},
|
||||
"homepage": "https://github.com/nodejs/nan#readme",
|
||||
"_id": "nan@2.0.9",
|
||||
"_shasum": "d02a770f46778842cceb94e17cab31ffc7234a05",
|
||||
"_resolved": "https://registry.npmjs.org/nan/-/nan-2.0.9.tgz",
|
||||
"_from": "nan@>=2.0.5 <2.1.0",
|
||||
"_npmVersion": "2.14.2",
|
||||
"_nodeVersion": "4.0.0",
|
||||
"_npmUser": {
|
||||
"name": "kkoopa",
|
||||
"email": "bbyholm@abo.fi"
|
||||
},
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "rvagg",
|
||||
"email": "rod@vagg.org"
|
||||
},
|
||||
{
|
||||
"name": "kkoopa",
|
||||
"email": "bbyholm@abo.fi"
|
||||
}
|
||||
],
|
||||
"dist": {
|
||||
"shasum": "d02a770f46778842cceb94e17cab31ffc7234a05",
|
||||
"tarball": "http://registry.npmjs.org/nan/-/nan-2.0.9.tgz"
|
||||
},
|
||||
"directories": {},
|
||||
"readme": "ERROR: No README data found!"
|
||||
}
|
||||
412
node_modules/sqlite3/node_modules/nan/tools/1to2.js
generated
vendored
Normal file
412
node_modules/sqlite3/node_modules/nan/tools/1to2.js
generated
vendored
Normal file
@@ -0,0 +1,412 @@
|
||||
#!/usr/bin/env node
|
||||
/*********************************************************************
|
||||
* NAN - Native Abstractions for Node.js
|
||||
*
|
||||
* Copyright (c) 2015 NAN contributors
|
||||
*
|
||||
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
|
||||
********************************************************************/
|
||||
|
||||
var commander = require('commander'),
|
||||
fs = require('fs'),
|
||||
glob = require('glob'),
|
||||
groups = [],
|
||||
total = 0,
|
||||
warning1 = '/* ERROR: Rewrite using Buffer */\n',
|
||||
warning2 = '\\/\\* ERROR\\: Rewrite using Buffer \\*\\/\\n',
|
||||
length,
|
||||
i;
|
||||
|
||||
fs.readFile('package.json', 'utf8', function (err, data) {
|
||||
if (err) {
|
||||
throw err;
|
||||
}
|
||||
|
||||
commander
|
||||
.version(JSON.parse(data).version)
|
||||
.usage('[options] <file ...>')
|
||||
.parse(process.argv);
|
||||
|
||||
if (!process.argv.slice(2).length) {
|
||||
commander.outputHelp();
|
||||
}
|
||||
});
|
||||
|
||||
/* construct strings representing regular expressions
|
||||
each expression contains a unique group allowing for identification of the match
|
||||
the index of this key group, relative to the regular expression in question,
|
||||
is indicated by the first array member */
|
||||
|
||||
/* simple substistutions, key group is the entire match, 0 */
|
||||
groups.push([0, [
|
||||
'_NAN_',
|
||||
'NODE_SET_METHOD',
|
||||
'NODE_SET_PROTOTYPE_METHOD',
|
||||
'NanAsciiString',
|
||||
'NanEscapeScope',
|
||||
'NanReturnValue',
|
||||
'NanUcs2String'].join('|')]);
|
||||
|
||||
/* substitutions of parameterless macros, key group is 1 */
|
||||
groups.push([1, ['(', [
|
||||
'NanEscapableScope',
|
||||
'NanReturnNull',
|
||||
'NanReturnUndefined',
|
||||
'NanScope'].join('|'), ')\\(\\)'].join('')]);
|
||||
|
||||
/* replace TryCatch with NanTryCatch once, gobbling possible namespace, key group 2 */
|
||||
groups.push([2, '(?:(?:v8\\:\\:)?|(Nan)?)(TryCatch)']);
|
||||
|
||||
/* NanNew("string") will likely not fail a ToLocalChecked(), key group 1 */
|
||||
groups.push([1, ['(NanNew)', '(\\("[^\\"]*"[^\\)]*\\))(?!\\.ToLocalChecked\\(\\))'].join('')]);
|
||||
|
||||
/* Removed v8 APIs, warn that the code needs rewriting using node::Buffer, key group 2 */
|
||||
groups.push([2, ['(', warning2, ')?', '^.*?(', [
|
||||
'GetIndexedPropertiesExternalArrayDataLength',
|
||||
'GetIndexedPropertiesExternalArrayData',
|
||||
'GetIndexedPropertiesExternalArrayDataType',
|
||||
'GetIndexedPropertiesPixelData',
|
||||
'GetIndexedPropertiesPixelDataLength',
|
||||
'HasIndexedPropertiesInExternalArrayData',
|
||||
'HasIndexedPropertiesInPixelData',
|
||||
'SetIndexedPropertiesToExternalArrayData',
|
||||
'SetIndexedPropertiesToPixelData'].join('|'), ')'].join('')]);
|
||||
|
||||
/* No need for NanScope in V8-exposed methods, key group 2 */
|
||||
groups.push([2, ['((', [
|
||||
'NAN_METHOD',
|
||||
'NAN_GETTER',
|
||||
'NAN_SETTER',
|
||||
'NAN_PROPERTY_GETTER',
|
||||
'NAN_PROPERTY_SETTER',
|
||||
'NAN_PROPERTY_ENUMERATOR',
|
||||
'NAN_PROPERTY_DELETER',
|
||||
'NAN_PROPERTY_QUERY',
|
||||
'NAN_INDEX_GETTER',
|
||||
'NAN_INDEX_SETTER',
|
||||
'NAN_INDEX_ENUMERATOR',
|
||||
'NAN_INDEX_DELETER',
|
||||
'NAN_INDEX_QUERY'].join('|'), ')\\([^\\)]*\\)\\s*\\{)\\s*NanScope\\(\\)\\s*;'].join('')]);
|
||||
|
||||
/* v8::Value::ToXXXXXXX returns v8::MaybeLocal<T>, key group 3 */
|
||||
groups.push([3, ['([\\s\\(\\)])([^\\s\\(\\)]+)->(', [
|
||||
'Boolean',
|
||||
'Number',
|
||||
'String',
|
||||
'Object',
|
||||
'Integer',
|
||||
'Uint32',
|
||||
'Int32'].join('|'), ')\\('].join('')]);
|
||||
|
||||
/* v8::Value::XXXXXXXValue returns v8::Maybe<T>, key group 3 */
|
||||
groups.push([3, ['([\\s\\(\\)])([^\\s\\(\\)]+)->((?:', [
|
||||
'Boolean',
|
||||
'Number',
|
||||
'Integer',
|
||||
'Uint32',
|
||||
'Int32'].join('|'), ')Value)\\('].join('')]);
|
||||
|
||||
/* NAN_WEAK_CALLBACK macro was removed, write out callback definition, key group 1 */
|
||||
groups.push([1, '(NAN_WEAK_CALLBACK)\\(([^\\s\\)]+)\\)']);
|
||||
|
||||
/* node::ObjectWrap and v8::Persistent have been replaced with Nan implementations, key group 1 */
|
||||
groups.push([1, ['(', [
|
||||
'NanDisposePersistent',
|
||||
'NanObjectWrapHandle'].join('|'), ')\\s*\\(\\s*([^\\s\\)]+)'].join('')]);
|
||||
|
||||
/* Since NanPersistent there is no need for NanMakeWeakPersistent, key group 1 */
|
||||
groups.push([1, '(NanMakeWeakPersistent)\\s*\\(\\s*([^\\s,]+)\\s*,\\s*']);
|
||||
|
||||
/* Many methods of v8::Object and others now return v8::MaybeLocal<T>, key group 3 */
|
||||
groups.push([3, ['([\\s])([^\\s]+)->(', [
|
||||
'GetEndColumn',
|
||||
'GetFunction',
|
||||
'GetLineNumber',
|
||||
'NewInstance',
|
||||
'GetPropertyNames',
|
||||
'GetOwnPropertyNames',
|
||||
'GetSourceLine',
|
||||
'GetStartColumn',
|
||||
'ObjectProtoToString',
|
||||
'ToArrayIndex',
|
||||
'ToDetailString',
|
||||
'CallAsConstructor',
|
||||
'CallAsFunction',
|
||||
'CloneElementAt',
|
||||
'Delete',
|
||||
'ForceSet',
|
||||
'Get',
|
||||
'GetPropertyAttributes',
|
||||
'GetRealNamedProperty',
|
||||
'GetRealNamedPropertyInPrototypeChain',
|
||||
'Has',
|
||||
'HasOwnProperty',
|
||||
'HasRealIndexedProperty',
|
||||
'HasRealNamedCallbackProperty',
|
||||
'HasRealNamedProperty',
|
||||
'Set',
|
||||
'SetAccessor',
|
||||
'SetIndexedPropertyHandler',
|
||||
'SetNamedPropertyHandler',
|
||||
'SetPrototype'].join('|'), ')\\('].join('')]);
|
||||
|
||||
/* You should get an error if any of these fail anyways,
|
||||
or handle the error better, it is indicated either way, key group 2 */
|
||||
groups.push([2, ['NanNew(<(?:v8\\:\\:)?(', ['Date', 'String', 'RegExp'].join('|'), ')>)(\\([^\\)]*\\))(?!\\.ToLocalChecked\\(\\))'].join('')]);
|
||||
|
||||
/* v8::Value::Equals now returns a v8::Maybe, key group 3 */
|
||||
groups.push([3, '([\\s\\(\\)])([^\\s\\(\\)]+)->(Equals)\\(([^\\s\\)]+)']);
|
||||
|
||||
/* NanPersistent makes this unnecessary, key group 1 */
|
||||
groups.push([1, '(NanAssignPersistent)(?:<v8\\:\\:[^>]+>)?\\(([^,]+),\\s*']);
|
||||
|
||||
/* args has been renamed to info, key group 2 */
|
||||
groups.push([2, '(\\W)(args)(\\W)'])
|
||||
|
||||
/* node::ObjectWrap was replaced with NanObjectWrap, key group 2 */
|
||||
groups.push([2, '(\\W)(?:node\\:\\:)?(ObjectWrap)(\\W)']);
|
||||
|
||||
/* v8::Persistent was replaced with NanPersistent, key group 2 */
|
||||
groups.push([2, '(\\W)(?:v8\\:\\:)?(Persistent)(\\W)']);
|
||||
|
||||
/* counts the number of capturing groups in a well-formed regular expression,
|
||||
ignoring non-capturing groups and escaped parentheses */
|
||||
function groupcount(s) {
|
||||
var positive = s.match(/\((?!\?)/g),
|
||||
negative = s.match(/\\\(/g);
|
||||
return (positive ? positive.length : 0) - (negative ? negative.length : 0);
|
||||
}
|
||||
|
||||
/* compute the absolute position of each key group in the joined master RegExp */
|
||||
for (i = 1, length = groups.length; i < length; i++) {
|
||||
total += groupcount(groups[i - 1][1]);
|
||||
groups[i][0] += total;
|
||||
}
|
||||
|
||||
/* create the master RegExp, whis is the union of all the groups' expressions */
|
||||
master = new RegExp(groups.map(function (a) { return a[1]; }).join('|'), 'gm');
|
||||
|
||||
/* replacement function for String.replace, receives 21 arguments */
|
||||
function replace() {
|
||||
/* simple expressions */
|
||||
switch (arguments[groups[0][0]]) {
|
||||
case '_NAN_':
|
||||
return 'NAN_';
|
||||
case 'NODE_SET_METHOD':
|
||||
return 'NanSetMethod';
|
||||
case 'NODE_SET_PROTOTYPE_METHOD':
|
||||
return 'NanSetPrototypeMethod';
|
||||
case 'NanAsciiString':
|
||||
return 'NanUtf8String';
|
||||
case 'NanEscapeScope':
|
||||
return 'scope.Escape';
|
||||
case 'NanReturnNull':
|
||||
return 'info.GetReturnValue().SetNull';
|
||||
case 'NanReturnValue':
|
||||
return 'info.GetReturnValue().Set';
|
||||
case 'NanUcs2String':
|
||||
return 'v8::String::Value';
|
||||
default:
|
||||
}
|
||||
|
||||
/* macros without arguments */
|
||||
switch (arguments[groups[1][0]]) {
|
||||
case 'NanEscapableScope':
|
||||
return 'NanEscapableScope scope'
|
||||
case 'NanReturnUndefined':
|
||||
return 'return';
|
||||
case 'NanScope':
|
||||
return 'NanScope scope';
|
||||
default:
|
||||
}
|
||||
|
||||
/* TryCatch, emulate negative backref */
|
||||
if (arguments[groups[2][0]] === 'TryCatch') {
|
||||
return arguments[groups[2][0] - 1] ? arguments[0] : 'NanTryCatch';
|
||||
}
|
||||
|
||||
/* NanNew("foo") --> NanNew("foo").ToLocalChecked() */
|
||||
if (arguments[groups[3][0]] === 'NanNew') {
|
||||
return [arguments[0], '.ToLocalChecked()'].join('');
|
||||
}
|
||||
|
||||
/* insert warning for removed functions as comment on new line above */
|
||||
switch (arguments[groups[4][0]]) {
|
||||
case 'GetIndexedPropertiesExternalArrayData':
|
||||
case 'GetIndexedPropertiesExternalArrayDataLength':
|
||||
case 'GetIndexedPropertiesExternalArrayDataType':
|
||||
case 'GetIndexedPropertiesPixelData':
|
||||
case 'GetIndexedPropertiesPixelDataLength':
|
||||
case 'HasIndexedPropertiesInExternalArrayData':
|
||||
case 'HasIndexedPropertiesInPixelData':
|
||||
case 'SetIndexedPropertiesToExternalArrayData':
|
||||
case 'SetIndexedPropertiesToPixelData':
|
||||
return arguments[groups[4][0] - 1] ? arguments[0] : [warning1, arguments[0]].join('');
|
||||
default:
|
||||
}
|
||||
|
||||
/* remove unnecessary NanScope() */
|
||||
switch (arguments[groups[5][0]]) {
|
||||
case 'NAN_GETTER':
|
||||
case 'NAN_METHOD':
|
||||
case 'NAN_SETTER':
|
||||
case 'NAN_INDEX_DELETER':
|
||||
case 'NAN_INDEX_ENUMERATOR':
|
||||
case 'NAN_INDEX_GETTER':
|
||||
case 'NAN_INDEX_QUERY':
|
||||
case 'NAN_INDEX_SETTER':
|
||||
case 'NAN_PROPERTY_DELETER':
|
||||
case 'NAN_PROPERTY_ENUMERATOR':
|
||||
case 'NAN_PROPERTY_GETTER':
|
||||
case 'NAN_PROPERTY_QUERY':
|
||||
case 'NAN_PROPERTY_SETTER':
|
||||
return arguments[groups[5][0] - 1];
|
||||
default:
|
||||
}
|
||||
|
||||
/* Value converstion */
|
||||
switch (arguments[groups[6][0]]) {
|
||||
case 'Boolean':
|
||||
case 'Int32':
|
||||
case 'Integer':
|
||||
case 'Number':
|
||||
case 'Object':
|
||||
case 'String':
|
||||
case 'Uint32':
|
||||
return [arguments[groups[6][0] - 2], 'NanTo<v8::', arguments[groups[6][0]], '>(', arguments[groups[6][0] - 1]].join('');
|
||||
default:
|
||||
}
|
||||
|
||||
/* other value conversion */
|
||||
switch (arguments[groups[7][0]]) {
|
||||
case 'BooleanValue':
|
||||
return [arguments[groups[7][0] - 2], 'NanTo<bool>(', arguments[groups[7][0] - 1]].join('');
|
||||
case 'Int32Value':
|
||||
return [arguments[groups[7][0] - 2], 'NanTo<int32_t>(', arguments[groups[7][0] - 1]].join('');
|
||||
case 'IntegerValue':
|
||||
return [arguments[groups[7][0] - 2], 'NanTo<int64_t>(', arguments[groups[7][0] - 1]].join('');
|
||||
case 'Uint32Value':
|
||||
return [arguments[groups[7][0] - 2], 'NanTo<uint32_t>(', arguments[groups[7][0] - 1]].join('');
|
||||
default:
|
||||
}
|
||||
|
||||
/* NAN_WEAK_CALLBACK */
|
||||
if (arguments[groups[8][0]] === 'NAN_WEAK_CALLBACK') {
|
||||
return ['template<typename T>\nvoid ',
|
||||
arguments[groups[8][0] + 1], '(const NanWeakCallbackInfo<T> &data)'].join('');
|
||||
}
|
||||
|
||||
/* use methods on NAN classes instead */
|
||||
switch (arguments[groups[9][0]]) {
|
||||
case 'NanDisposePersistent':
|
||||
return [arguments[groups[9][0] + 1], '.Reset('].join('');
|
||||
case 'NanObjectWrapHandle':
|
||||
return [arguments[groups[9][0] + 1], '->handle('].join('');
|
||||
default:
|
||||
}
|
||||
|
||||
/* use method on NanPersistent instead */
|
||||
if (arguments[groups[10][0]] === 'NanMakeWeakPersistent') {
|
||||
return arguments[groups[10][0] + 1] + '.SetWeak(';
|
||||
}
|
||||
|
||||
/* These return Maybes, the upper ones take no arguments */
|
||||
switch (arguments[groups[11][0]]) {
|
||||
case 'GetEndColumn':
|
||||
case 'GetFunction':
|
||||
case 'GetLineNumber':
|
||||
case 'GetOwnPropertyNames':
|
||||
case 'GetPropertyNames':
|
||||
case 'GetSourceLine':
|
||||
case 'GetStartColumn':
|
||||
case 'NewInstance':
|
||||
case 'ObjectProtoToString':
|
||||
case 'ToArrayIndex':
|
||||
case 'ToDetailString':
|
||||
return [arguments[groups[11][0] - 2], 'Nan', arguments[groups[11][0]], '(', arguments[groups[11][0] - 1]].join('');
|
||||
case 'CallAsConstructor':
|
||||
case 'CallAsFunction':
|
||||
case 'CloneElementAt':
|
||||
case 'Delete':
|
||||
case 'ForceSet':
|
||||
case 'Get':
|
||||
case 'GetPropertyAttributes':
|
||||
case 'GetRealNamedProperty':
|
||||
case 'GetRealNamedPropertyInPrototypeChain':
|
||||
case 'Has':
|
||||
case 'HasOwnProperty':
|
||||
case 'HasRealIndexedProperty':
|
||||
case 'HasRealNamedCallbackProperty':
|
||||
case 'HasRealNamedProperty':
|
||||
case 'Set':
|
||||
case 'SetAccessor':
|
||||
case 'SetIndexedPropertyHandler':
|
||||
case 'SetNamedPropertyHandler':
|
||||
case 'SetPrototype':
|
||||
return [arguments[groups[11][0] - 2], 'Nan', arguments[groups[11][0]], '(', arguments[groups[11][0] - 1], ', '].join('');
|
||||
default:
|
||||
}
|
||||
|
||||
/* Automatic ToLocalChecked(), take it or leave it */
|
||||
switch (arguments[groups[12][0]]) {
|
||||
case 'Date':
|
||||
case 'String':
|
||||
case 'RegExp':
|
||||
return ['NanNew', arguments[groups[12][0] - 1], arguments[groups[12][0] + 1], '.ToLocalChecked()'].join('');
|
||||
default:
|
||||
}
|
||||
|
||||
/* NanEquals is now required for uniformity */
|
||||
if (arguments[groups[13][0]] === 'Equals') {
|
||||
return [arguments[groups[13][0] - 1], 'NanEquals(', arguments[groups[13][0] - 1], ', ', arguments[groups[13][0] + 1]].join('');
|
||||
}
|
||||
|
||||
/* use method on replacement class instead */
|
||||
if (arguments[groups[14][0]] === 'NanAssignPersistent') {
|
||||
return [arguments[groups[14][0] + 1], '.Reset('].join('');
|
||||
}
|
||||
|
||||
/* args --> info */
|
||||
if (arguments[groups[15][0]] === 'args') {
|
||||
return [arguments[groups[15][0] - 1], 'info', arguments[groups[15][0] + 1]].join('');
|
||||
}
|
||||
|
||||
/* ObjectWrap --> NanObjectWrap */
|
||||
if (arguments[groups[16][0]] === 'ObjectWrap') {
|
||||
return [arguments[groups[16][0] - 1], 'NanObjectWrap', arguments[groups[16][0] + 1]].join('');
|
||||
}
|
||||
|
||||
/* Persistent --> NanPersistent */
|
||||
if (arguments[groups[17][0]] === 'Persistent') {
|
||||
return [arguments[groups[17][0] - 1], 'NanPersistent', arguments[groups[17][0] + 1]].join('');
|
||||
}
|
||||
|
||||
/* This should not happen. A switch is probably missing a case if it does. */
|
||||
throw 'Unhandled match: ' + arguments[0];
|
||||
}
|
||||
|
||||
/* reads a file, runs replacement and writes it back */
|
||||
function processFile(file) {
|
||||
fs.readFile(file, {encoding: 'utf8'}, function (err, data) {
|
||||
if (err) {
|
||||
throw err;
|
||||
}
|
||||
|
||||
/* run replacement twice, might need more runs */
|
||||
fs.writeFile(file, data.replace(master, replace).replace(master, replace), function (err) {
|
||||
if (err) {
|
||||
throw err;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/* process file names from command line and process the identified files */
|
||||
for (i = 2, length = process.argv.length; i < length; i++) {
|
||||
glob(process.argv[i], function (err, matches) {
|
||||
if (err) {
|
||||
throw err;
|
||||
}
|
||||
matches.forEach(processFile);
|
||||
});
|
||||
}
|
||||
14
node_modules/sqlite3/node_modules/nan/tools/README.md
generated
vendored
Normal file
14
node_modules/sqlite3/node_modules/nan/tools/README.md
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
1to2 naively converts source code files from NAN 1 to NAN 2. There will be erroneous conversions,
|
||||
false positives and missed opportunities. The input files are rewritten in place. Make sure that
|
||||
you have backups. You will have to manually review the changes afterwards and do some touchups.
|
||||
|
||||
```sh
|
||||
$ tools/1to2.js
|
||||
|
||||
Usage: 1to2 [options] <file ...>
|
||||
|
||||
Options:
|
||||
|
||||
-h, --help output usage information
|
||||
-V, --version output the version number
|
||||
```
|
||||
19
node_modules/sqlite3/node_modules/nan/tools/package.json
generated
vendored
Normal file
19
node_modules/sqlite3/node_modules/nan/tools/package.json
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "1to2",
|
||||
"version": "1.0.0",
|
||||
"description": "NAN 1 -> 2 Migration Script",
|
||||
"main": "1to2.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/nodejs/nan.git"
|
||||
},
|
||||
"contributors": [
|
||||
"Benjamin Byholm <bbyholm@abo.fi> (https://github.com/kkoopa/)",
|
||||
"Mathias Küsel (https://github.com/mathiask88/)"
|
||||
],
|
||||
"dependencies": {
|
||||
"glob": "~5.0.10",
|
||||
"commander": "~2.8.1"
|
||||
},
|
||||
"license": "MIT"
|
||||
}
|
||||
239
node_modules/sqlite3/node_modules/node-pre-gyp/CHANGELOG.md
generated
vendored
Normal file
239
node_modules/sqlite3/node_modules/node-pre-gyp/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,239 @@
|
||||
# node-pre-gyp changelog
|
||||
|
||||
## 0.6.10
|
||||
|
||||
- Added known node and io.js versions including 3.x and 4.x versions
|
||||
- Upgraded `tar` dep
|
||||
|
||||
## 0.6.9
|
||||
|
||||
- Upgraded `rc` dep
|
||||
- Updated known io.js version: v2.4.0
|
||||
|
||||
## 0.6.8
|
||||
|
||||
- Upgraded `semver` and `rimraf` deps
|
||||
- Updated known node and io.js versions
|
||||
|
||||
## 0.6.7
|
||||
|
||||
- Fixed `node_abi` versions for io.js 1.1.x -> 1.8.x (should be 43, but was stored as 42) (refs https://github.com/iojs/build/issues/94)
|
||||
|
||||
## 0.6.6
|
||||
|
||||
- Updated with known io.js 2.0.0 version
|
||||
|
||||
## 0.6.5
|
||||
|
||||
- Now respecting `npm_config_node_gyp` (https://github.com/npm/npm/pull/4887)
|
||||
- Updated to semver@4.3.2
|
||||
- Updated known node v0.12.x versions and io.js 1.x versions.
|
||||
|
||||
## 0.6.4
|
||||
|
||||
- Improved support for `io.js` (@fengmk2)
|
||||
- Test coverage improvements (@mikemorris)
|
||||
- Fixed support for `--dist-url` that regressed in 0.6.3
|
||||
|
||||
## 0.6.3
|
||||
|
||||
- Added support for passing raw options to node-gyp using `--` separator. Flags passed after
|
||||
the `--` to `node-pre-gyp configure` will be passed directly to gyp while flags passed
|
||||
after the `--` will be passed directly to make/visual studio.
|
||||
- Added `node-pre-gyp configure` command to be able to call `node-gyp configure` directly
|
||||
- Fix issue with require validation not working on windows 7 (@edgarsilva)
|
||||
|
||||
## 0.6.2
|
||||
|
||||
- Support for io.js >= v1.0.2
|
||||
- Deferred require of `request` and `tar` to help speed up command line usage of `node-pre-gyp`.
|
||||
|
||||
## 0.6.1
|
||||
|
||||
- Fixed bundled `tar` version
|
||||
|
||||
## 0.6.0
|
||||
|
||||
- BREAKING: node odd releases like v0.11.x now use `major.minor.patch` for `{node_abi}` instead of `NODE_MODULE_VERSION` (#124)
|
||||
- Added support for `toolset` option in versioning. By default is an empty string but `--toolset` can be passed to publish or install to select alternative binaries that target a custom toolset like C++11. For example to target Visual Studio 2014 modules like node-sqlite3 use `--toolset=v140`.
|
||||
- Added support for `--no-rollback` option to request that a failed binary test does not remove the binary module leaves it in place.
|
||||
- Added support for `--update-binary` option to request an existing binary be re-installed and the check for a valid local module be skipped.
|
||||
- Added support for passing build options from `npm` through `node-pre-gyp` to `node-gyp`: `--nodedir`, `--disturl`, `--python`, and `--msvs_version`
|
||||
|
||||
## 0.5.31
|
||||
|
||||
- Added support for deducing node_abi for node.js runtime from previous release if the series is even
|
||||
- Added support for --target=0.10.33
|
||||
|
||||
## 0.5.30
|
||||
|
||||
- Repackaged with latest bundled deps
|
||||
|
||||
## 0.5.29
|
||||
|
||||
- Added support for semver `build`.
|
||||
- Fixed support for downloading from urls that include `+`.
|
||||
|
||||
## 0.5.28
|
||||
|
||||
- Now reporting unix style paths only in reveal command
|
||||
|
||||
## 0.5.27
|
||||
|
||||
- Fixed support for auto-detecting s3 bucket name when it contains `.` - @taavo
|
||||
- Fixed support for installing when path contains a `'` - @halfdan
|
||||
- Ported tests to mocha
|
||||
|
||||
## 0.5.26
|
||||
|
||||
- Fix node-webkit support when `--target` option is not provided
|
||||
|
||||
## 0.5.25
|
||||
|
||||
- Fix bundling of deps
|
||||
|
||||
## 0.5.24
|
||||
|
||||
- Updated ABI crosswalk to incldue node v0.10.30 and v0.10.31
|
||||
|
||||
## 0.5.23
|
||||
|
||||
- Added `reveal` command. Pass no options to get all versioning data as json. Pass a second arg to grab a single versioned property value
|
||||
- Added support for `--silent` (shortcut for `--loglevel=silent`)
|
||||
|
||||
## 0.5.22
|
||||
|
||||
- Fixed node-webkit versioning name (NOTE: node-webkit support still experimental)
|
||||
|
||||
## 0.5.21
|
||||
|
||||
- New package to fix `shasum check failed` error with v0.5.20
|
||||
|
||||
## 0.5.20
|
||||
|
||||
- Now versioning node-webkit binaries based on major.minor.patch - assuming no compatible ABI across versions (#90)
|
||||
|
||||
## 0.5.19
|
||||
|
||||
- Updated to know about more node-webkit releases
|
||||
|
||||
## 0.5.18
|
||||
|
||||
- Updated to know about more node-webkit releases
|
||||
|
||||
## 0.5.17
|
||||
|
||||
- Updated to know about node v0.10.29 release
|
||||
|
||||
## 0.5.16
|
||||
|
||||
- Now supporting all aws-sdk configuration parameters (http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/node-configuring.html) (#86)
|
||||
|
||||
## 0.5.15
|
||||
|
||||
- Fixed installation of windows packages sub directories on unix systems (#84)
|
||||
|
||||
## 0.5.14
|
||||
|
||||
- Finished support for cross building using `--target_platform` option (#82)
|
||||
- Now skipping binary validation on install if target arch/platform do not match the host.
|
||||
- Removed multi-arch validing for OS X since it required a FAT node.js binary
|
||||
|
||||
## 0.5.13
|
||||
|
||||
- Fix problem in 0.5.12 whereby the wrong versions of mkdirp and semver where bundled.
|
||||
|
||||
## 0.5.12
|
||||
|
||||
- Improved support for node-webkit (@Mithgol)
|
||||
|
||||
## 0.5.11
|
||||
|
||||
- Updated target versions listing
|
||||
|
||||
## 0.5.10
|
||||
|
||||
- Fixed handling of `-debug` flag passed directory to node-pre-gyp (#72)
|
||||
- Added optional second arg to `node_pre_gyp.find` to customize the default versioning options used to locate the runtime binary
|
||||
- Failed install due to `testbinary` check failure no longer leaves behind binary (#70)
|
||||
|
||||
## 0.5.9
|
||||
|
||||
- Fixed regression in `testbinary` command causing installs to fail on windows with 0.5.7 (#60)
|
||||
|
||||
## 0.5.8
|
||||
|
||||
- Started bundling deps
|
||||
|
||||
## 0.5.7
|
||||
|
||||
- Fixed the `testbinary` check, which is used to determine whether to re-download or source compile, to work even in complex dependency situations (#63)
|
||||
- Exposed the internal `testbinary` command in node-pre-gyp command line tool
|
||||
- Fixed minor bug so that `fallback_to_build` option is always respected
|
||||
|
||||
## 0.5.6
|
||||
|
||||
- Added support for versioning on the `name` value in `package.json` (#57).
|
||||
- Moved to using streams for reading tarball when publishing (#52)
|
||||
|
||||
## 0.5.5
|
||||
|
||||
- Improved binary validation that also now works with node-webkit (@Mithgol)
|
||||
- Upgraded test apps to work with node v0.11.x
|
||||
- Improved test coverage
|
||||
|
||||
## 0.5.4
|
||||
|
||||
- No longer depends on external install of node-gyp for compiling builds.
|
||||
|
||||
## 0.5.3
|
||||
|
||||
- Reverted fix for debian/nodejs since it broke windows (#45)
|
||||
|
||||
## 0.5.2
|
||||
|
||||
- Support for debian systems where the node binary is named `nodejs` (#45)
|
||||
- Added `bin/node-pre-gyp.cmd` to be able to run command on windows locally (npm creates an .npm automatically when globally installed)
|
||||
- Updated abi-crosswalk with node v0.10.26 entry.
|
||||
|
||||
## 0.5.1
|
||||
|
||||
- Various minor bug fixes, several improving windows support for publishing.
|
||||
|
||||
## 0.5.0
|
||||
|
||||
- Changed property names in `binary` object: now required are `module_name`, `module_path`, and `host`.
|
||||
- Now `module_path` supports versioning, which allows developers to opt-in to using a versioned install path (#18).
|
||||
- Added `remote_path` which also supports versioning.
|
||||
- Changed `remote_uri` to `host`.
|
||||
|
||||
## 0.4.2
|
||||
|
||||
- Added support for `--target` flag to request cross-compile against a specific node/node-webkit version.
|
||||
- Added preliminary support for node-webkit
|
||||
- Fixed support for `--target_arch` option being respected in all cases.
|
||||
|
||||
## 0.4.1
|
||||
|
||||
- Fixed exception when only stderr is available in binary test (@bendi / #31)
|
||||
|
||||
## 0.4.0
|
||||
|
||||
- Enforce only `https:` based remote publishing access.
|
||||
- Added `node-pre-gyp info` command to display listing of published binaries
|
||||
- Added support for changing the directory node-pre-gyp should build in with the `-C/--directory` option.
|
||||
- Added support for S3 prefixes.
|
||||
|
||||
## 0.3.1
|
||||
|
||||
- Added `unpublish` command.
|
||||
- Fixed module path construction in tests.
|
||||
- Added ability to disable falling back to build behavior via `npm install --fallback-to-build=false` which overrides setting in a depedencies package.json `install` target.
|
||||
|
||||
## 0.3.0
|
||||
|
||||
- Support for packaging all files in `module_path` directory - see `app4` for example
|
||||
- Added `testpackage` command.
|
||||
- Changed `clean` command to only delete `.node` not entire `build` directory since node-gyp will handle that.
|
||||
- `.node` modules must be in a folder of there own since tar-pack will remove everything when it unpacks.
|
||||
|
||||
27
node_modules/sqlite3/node_modules/node-pre-gyp/LICENSE
generated
vendored
Normal file
27
node_modules/sqlite3/node_modules/node-pre-gyp/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
Copyright (c), Mapbox
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
* Neither the name of node-pre-gyp nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
581
node_modules/sqlite3/node_modules/node-pre-gyp/README.md
generated
vendored
Normal file
581
node_modules/sqlite3/node_modules/node-pre-gyp/README.md
generated
vendored
Normal file
@@ -0,0 +1,581 @@
|
||||
# node-pre-gyp
|
||||
|
||||
#### node-pre-gyp makes it easy to publish and install Node.js C++ addons from binaries
|
||||
|
||||
[](https://nodei.co/npm/node-pre-gyp/)
|
||||
|
||||
[](https://travis-ci.org/mapbox/node-pre-gyp)
|
||||
[](https://ci.appveyor.com/project/Mapbox/node-pre-gyp)
|
||||
[](https://david-dm.org/mapbox/node-pre-gyp)
|
||||
|
||||
`node-pre-gyp` stands between [npm](https://github.com/npm/npm) and [node-gyp](https://github.com/Tootallnate/node-gyp) and offers a cross-platform method of binary deployment.
|
||||
|
||||
### Features
|
||||
|
||||
- A command line tool called `node-pre-gyp` that can install your package's c++ module from a binary.
|
||||
- A variety of developer targeted commands for packaging, testing, and publishing binaries.
|
||||
- A Javascript module that can dynamically require your installed binary: `require('node-pre-gyp').find`
|
||||
|
||||
For a hello world example of a module packaged with `node-pre-gyp` see <https://github.com/springmeyer/node-addon-example> and [the wiki ](https://github.com/mapbox/node-pre-gyp/wiki/Modules-using-node-pre-gyp) for real world examples.
|
||||
|
||||
## Credits
|
||||
|
||||
- The module is modeled after [node-gyp](https://github.com/Tootallnate/node-gyp) by [@Tootallnate](https://github.com/Tootallnate)
|
||||
- Motivation for initial development came from [@ErisDS](https://github.com/ErisDS) and the [Ghost Project](https://github.com/TryGhost/Ghost).
|
||||
- Development is sponsored by [Mapbox](https://www.mapbox.com/)
|
||||
|
||||
## FAQ
|
||||
|
||||
See the [Frequently Ask Questions](https://github.com/mapbox/node-pre-gyp/wiki/FAQ).
|
||||
|
||||
## Depends
|
||||
|
||||
- Node.js 0.12.x -> 0.8.x
|
||||
|
||||
## Install
|
||||
|
||||
`node-pre-gyp` is designed to be installed as a local dependency of your Node.js C++ addon and accessed like:
|
||||
|
||||
./node_modules/.bin/node-pre-gyp --help
|
||||
|
||||
But you can also install it globally:
|
||||
|
||||
npm install node-pre-gyp -g
|
||||
|
||||
## Usage
|
||||
|
||||
### Commands
|
||||
|
||||
View all possible commands:
|
||||
|
||||
node-pre-gyp --help
|
||||
|
||||
- clean - Remove the entire folder containing the compiled .node module
|
||||
- install - Install pre-built binary for module
|
||||
- reinstall - Run "clean" and "install" at once
|
||||
- build - Compile the module by dispatching to node-gyp or nw-gyp
|
||||
- rebuild - Run "clean" and "build" at once
|
||||
- package - Pack binary into tarball
|
||||
- testpackage - Test that the staged package is valid
|
||||
- publish - Publish pre-built binary
|
||||
- unpublish - Unpublish pre-built binary
|
||||
- info - Fetch info on published binaries
|
||||
|
||||
You can also chain commands:
|
||||
|
||||
node-pre-gyp clean build unpublish publish info
|
||||
|
||||
### Options
|
||||
|
||||
Options include:
|
||||
|
||||
- `-C/--directory`: run the command in this directory
|
||||
- `--build-from-source`: build from source instead of using pre-built binary
|
||||
- `--runtime=node-webkit`: customize the runtime: `node` and `node-webkit` are the valid options
|
||||
- `--fallback-to-build`: fallback to building from source if pre-built binary is not available
|
||||
- `--target=0.10.25`: Pass the target node or node-webkit version to compile against
|
||||
- `--target_arch=ia32`: Pass the target arch and override the host `arch`. Valid values are 'ia32','x64', or `arm`.
|
||||
- `--target_platform=win32`: Pass the target platform and override the host `platform`. Valid values are `linux`, `darwin`, `win32`, `sunos`, `freebsd`, `openbsd`, and `aix`.
|
||||
|
||||
Both `--build-from-source` and `--fallback-to-build` can be passed alone or they can provide values. You can pass `--fallback-to-build=false` to override the option as declared in package.json. In addition to being able to pass `--build-from-source` you can also pass `--build-from-source=myapp` where `myapp` is the name of your module.
|
||||
|
||||
For example: `npm install --build-from-source=myapp`. This is useful if:
|
||||
|
||||
- `myapp` is referenced in the package.json of a larger app and therefore `myapp` is being installed as a dependent with `npm install`.
|
||||
- The larger app also depends on other modules installed with `node-pre-gyp`
|
||||
- You only want to trigger a source compile for `myapp` and the other modules.
|
||||
|
||||
### Configuring
|
||||
|
||||
This is a guide to configuring your module to use node-pre-gyp.
|
||||
|
||||
#### 1) Add new entries to your `package.json`
|
||||
|
||||
- Add `node-pre-gyp` to `bundledDependencies`
|
||||
- Add `aws-sdk` as a `devDependency`
|
||||
- Add a custom `install` script
|
||||
- Declare a `binary` object
|
||||
|
||||
This looks like:
|
||||
|
||||
```js
|
||||
"dependencies" : {
|
||||
"node-pre-gyp": "0.5.x"
|
||||
},
|
||||
"bundledDependencies":["node-pre-gyp"],
|
||||
"devDependencies": {
|
||||
"aws-sdk": "~2.0.0-rc.15"
|
||||
}
|
||||
"scripts": {
|
||||
"install": "node-pre-gyp install --fallback-to-build",
|
||||
},
|
||||
"binary": {
|
||||
"module_name": "your_module",
|
||||
"module_path": "./lib/binding/",
|
||||
"host": "https://your_module.s3-us-west-1.amazonaws.com"
|
||||
}
|
||||
```
|
||||
|
||||
For a full example see [node-addon-examples's package.json](https://github.com/springmeyer/node-addon-example/blob/2ff60a8ded7f042864ad21db00c3a5a06cf47075/package.json#L11-L22).
|
||||
|
||||
##### The `binary` object has three required properties
|
||||
|
||||
###### module_name
|
||||
|
||||
The name of your native node module. This value must:
|
||||
|
||||
- Match the name passed to [the NODE_MODULE macro](http://nodejs.org/api/addons.html#addons_hello_world)
|
||||
- Must be a valid C variable name (e.g. it cannot contain `-`)
|
||||
- Should not include the `.node` extension.
|
||||
|
||||
###### module_path
|
||||
|
||||
The location your native module is placed after a build. This should be an empty directory without other Javascript files. This entire directory will be packaged in the binary tarball. When installing from a remote package this directory will be overwritten with the contents of the tarball.
|
||||
|
||||
Note: This property supports variables based on [Versioning](#versioning).
|
||||
|
||||
###### host
|
||||
|
||||
A url to the remote location where you've published tarball binaries (must be `https` not `http`).
|
||||
|
||||
It is highly recommended that you use Amazon S3. The reasons are:
|
||||
|
||||
- Various node-pre-gyp commands like `publish` and `info` only work with an S3 host.
|
||||
- S3 is a very solid hosting platform for distributing large files, even [Github recommends using it instead of github](https://help.github.com/articles/distributing-large-binaries).
|
||||
- We provide detail documentation for using [S3 hosting](#s3-hosting) with node-pre-gyp.
|
||||
|
||||
Why then not require S3? Because while some applications using node-pre-gyp need to distribute binaries as large as 20-30 MB, others might have very small binaries and might wish to store them in a github repo. This is not recommended, but if an author really wants to host in a non-s3 location then it should be possible.
|
||||
|
||||
##### The `binary` object has two optional properties
|
||||
|
||||
###### remote_path
|
||||
|
||||
It **is recommended** that you customize this property. This is an extra path to use for publishing and finding remote tarballs. The default value for `remote_path` is `""` meaning that if you do not provide it then all packages will be published at the base of the `host`. It is recommended to provide a value like `./{name}/v{version}` to help organize remote packages in the case that you choose to publish multiple node addons to the same `host`.
|
||||
|
||||
Note: This property supports variables based on [Versioning](#versioning).
|
||||
|
||||
###### package_name
|
||||
|
||||
It is **not recommended** to override this property unless you are also overriding the `remote_path`. This is the versioned name of the remote tarball containing the binary `.node` module and any supporting files you've placed inside the `module_path` directory. Unless you specify `package_name` in your `package.json` then it defaults to `{module_name}-v{version}-{node_abi}-{platform}-{arch}.tar.gz` which allows your binary to work across node versions, platforms, and architectures. If you are using `remote_path` that is also versioned by `./{module_name}/v{version}` then you could remove these variables from the `package_name` and just use: `{node_abi}-{platform}-{arch}.tar.gz`. Then your remote tarball will be looked up at, for example, `https://example.com/your-module/v0.1.0/node-v11-linux-x64.tar.gz`.
|
||||
|
||||
Avoiding the version of your module in the `package_name` and instead only embedding in a directory name can be useful when you want to make a quick tag of your module that does not change any C++ code. In this case you can just copy binaries to the new version behind the scenes like:
|
||||
|
||||
```sh
|
||||
aws s3 sync --acl public-read s3://mapbox-node-binary/sqlite3/v3.0.3/ s3://mapbox-node-binary/sqlite3/v3.0.4/
|
||||
```
|
||||
|
||||
Note: This property supports variables based on [Versioning](#versioning).
|
||||
|
||||
#### 2) Add a new target to binding.gyp
|
||||
|
||||
`node-pre-gyp` calls out to `node-gyp` to compile the module and passes variables along like [module_name](#module_name) and [module_path](#module_path).
|
||||
|
||||
A new target must be added to `binding.gyp` that moves the compiled `.node` module from `./build/Release/module_name.node` into the directory specified by `module_path`.
|
||||
|
||||
Add a target like this at the end of your `targets` list:
|
||||
|
||||
```js
|
||||
{
|
||||
"target_name": "action_after_build",
|
||||
"type": "none",
|
||||
"dependencies": [ "<(module_name)" ],
|
||||
"copies": [
|
||||
{
|
||||
"files": [ "<(PRODUCT_DIR)/<(module_name).node" ],
|
||||
"destination": "<(module_path)"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
For a full example see [node-addon-example's binding.gyp](https://github.com/springmeyer/node-addon-example/blob/2ff60a8ded7f042864ad21db00c3a5a06cf47075/binding.gyp).
|
||||
|
||||
#### 3) Dynamically require your `.node`
|
||||
|
||||
Inside the main js file that requires your addon module you are likely currently doing:
|
||||
|
||||
```js
|
||||
var binding = require('../build/Release/binding.node');
|
||||
```
|
||||
|
||||
or:
|
||||
|
||||
```js
|
||||
var bindings = require('./bindings')
|
||||
```
|
||||
|
||||
Change those lines to:
|
||||
|
||||
```js
|
||||
var binary = require('node-pre-gyp');
|
||||
var path = require('path');
|
||||
var binding_path = binary.find(path.resolve(path.join(__dirname,'./package.json')));
|
||||
var binding = require(binding_path);
|
||||
```
|
||||
|
||||
For a full example see [node-addon-example's index.js](https://github.com/springmeyer/node-addon-example/blob/2ff60a8ded7f042864ad21db00c3a5a06cf47075/index.js#L1-L4)
|
||||
|
||||
#### 4) Build and package your app
|
||||
|
||||
Now build your module from source:
|
||||
|
||||
npm install --build-from-source
|
||||
|
||||
The `--build-from-source` tells `node-pre-gyp` to not look for a remote package and instead dispatch to node-gyp to build.
|
||||
|
||||
Now `node-pre-gyp` should now also be installed as a local dependency so the command line tool it offers can be found at `./node_modules/.bin/node-pre-gyp`.
|
||||
|
||||
#### 5) Test
|
||||
|
||||
Now `npm test` should work just as it did before.
|
||||
|
||||
#### 6) Publish the tarball
|
||||
|
||||
Then package your app:
|
||||
|
||||
./node_modules/.bin/node-pre-gyp package
|
||||
|
||||
Once packaged, now you can publish:
|
||||
|
||||
./node_modules/.bin/node-pre-gyp publish
|
||||
|
||||
Currently the `publish` command pushes your binary to S3. This requires:
|
||||
|
||||
- You have installed `aws-sdk` with `npm install aws-sdk`
|
||||
- You have created a bucket already.
|
||||
- The `host` points to an S3 http or https endpoint.
|
||||
- You have configured node-pre-gyp to read your S3 credentials (see [S3 hosting](#s3-hosting) for details).
|
||||
|
||||
You can also host your binaries elsewhere. To do this requires:
|
||||
|
||||
- You manually publish the binary created by the `package` command to an `https` endpoint
|
||||
- Ensure that the `host` value points to your custom `https` endpoint.
|
||||
|
||||
#### 7) Automate builds
|
||||
|
||||
Now you need to publish builds for all the platforms and node versions you wish to support. This is best automated.
|
||||
|
||||
- See [Appveyor Automation](#appveyor-automation) for how to auto-publish builds on Windows.
|
||||
- See [Travis Automation](#travis-automation) for how to auto-publish builds on OS X and Linux.
|
||||
|
||||
#### 8) You're done!
|
||||
|
||||
Now publish your module to the npm registry. Users will now be able to install your module from a binary.
|
||||
|
||||
What will happen is this:
|
||||
|
||||
1. `npm install <your package>` will pull from the npm registry
|
||||
2. npm will run the `install` script which will call out to `node-pre-gyp`
|
||||
3. `node-pre-gyp` will fetch the binary `.node` module and unpack in the right place
|
||||
4. Assuming that all worked, you are done
|
||||
|
||||
If a a binary was not available for a given platform and `--fallback-to-build` was used then `node-gyp rebuild` will be called to try to source compile the module.
|
||||
|
||||
## S3 Hosting
|
||||
|
||||
You can host wherever you choose but S3 is cheap, `node-pre-gyp publish` expects it, and S3 can be integrated well with [travis.ci](http://travis-ci.org) to automate builds for OS X and Ubuntu. Here is an approach to do this:
|
||||
|
||||
First, get setup locally and test the workflow:
|
||||
|
||||
#### 1) Create an S3 bucket
|
||||
|
||||
And have your **key** and **secret key** ready for writing to the bucket.
|
||||
|
||||
It is recommended to create a IAM user with a policy that only gives permissions to the specific bucket you plan to publish to. This can be done in the [IAM console](https://console.aws.amazon.com/iam/) by: 1) adding a new user, 2) choosing `Attach User Policy`, 3) Using the `Policy Generator`, 4) selecting `Amazon S3` for the service, 5) adding the actions: `DeleteObject`, `GetObject`, `GetObjectAcl`, `ListBucket`, `PutObject`, `PutObjectAcl`, 6) adding an ARN of `arn:aws:s3:::bucket/*` (replacing `bucket` with your bucket name), and finally 7) clicking `Add Statement` and saving the policy. It should generate a policy like:
|
||||
|
||||
```js
|
||||
{
|
||||
"Version": "2012-10-17",
|
||||
"Statement": [
|
||||
{
|
||||
"Sid": "Stmt1394587197000",
|
||||
"Effect": "Allow",
|
||||
"Action": [
|
||||
"s3:DeleteObject",
|
||||
"s3:GetObject",
|
||||
"s3:GetObjectAcl",
|
||||
"s3:ListBucket",
|
||||
"s3:PutObject",
|
||||
"s3:PutObjectAcl"
|
||||
],
|
||||
"Resource": [
|
||||
"arn:aws:s3:::node-pre-gyp-tests/*"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
#### 2) Install node-pre-gyp
|
||||
|
||||
Either install it globally:
|
||||
|
||||
npm install node-pre-gyp -g
|
||||
|
||||
Or put the local version on your PATH
|
||||
|
||||
export PATH=`pwd`/node_modules/.bin/:$PATH
|
||||
|
||||
#### 3) Configure AWS credentials
|
||||
|
||||
There are several ways to do this.
|
||||
|
||||
You can use any of the methods described at http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/node-configuring.html.
|
||||
|
||||
Or you can create a `~/.node_pre_gyprc`
|
||||
|
||||
Or pass options in any way supported by [RC](https://github.com/dominictarr/rc#standards)
|
||||
|
||||
A `~/.node_pre_gyprc` looks like:
|
||||
|
||||
```js
|
||||
{
|
||||
"accessKeyId": "xxx",
|
||||
"secretAccessKey": "xxx"
|
||||
}
|
||||
```
|
||||
|
||||
Another way is to use your environment:
|
||||
|
||||
export node_pre_gyp_accessKeyId=xxx
|
||||
export node_pre_gyp_secretAccessKey=xxx
|
||||
|
||||
You may also need to specify the `region` if it is not explicit in the `host` value you use. The `bucket` can also be specified but it is optional because `node-pre-gyp` will detect it from the `host` value.
|
||||
|
||||
#### 4) Package and publish your build
|
||||
|
||||
Install the `aws-sdk`:
|
||||
|
||||
npm install aws-sdk
|
||||
|
||||
Then publish:
|
||||
|
||||
node-pre-gyp package publish
|
||||
|
||||
Note: if you hit an error like `Hostname/IP doesn't match certificate's altnames` it may mean that you need to provide the `region` option in your config.
|
||||
|
||||
## Appveyor Automation
|
||||
|
||||
[Appveyor](http://www.appveyor.com/) can build binaries and publish the results per commit and supports:
|
||||
|
||||
- Windows Visual Studio 2013 and related compilers
|
||||
- Both 64 bit (x64) and 32 bit (x86) build configurations
|
||||
- Multiple Node.js versions
|
||||
|
||||
For an example of doing this see [node-sqlite3's appveyor.yml](https://github.com/mapbox/node-sqlite3/blob/master/appveyor.yml).
|
||||
|
||||
Below is a guide to getting set up:
|
||||
|
||||
#### 1) Create a free Appveyor account
|
||||
|
||||
Go to https://ci.appveyor.com/signup/free and sign in with your github account.
|
||||
|
||||
#### 2) Create a new project
|
||||
|
||||
Go to https://ci.appveyor.com/projects/new and select the github repo for your module
|
||||
|
||||
#### 3) Add appveyor.yml and push it
|
||||
|
||||
Once you have committed an `appveyor.yml` ([appveyor.yml reference](http://www.appveyor.com/docs/appveyor-yml)) to your github repo and pushed it appveyor should automatically start building your project.
|
||||
|
||||
#### 4) Create secure variables
|
||||
|
||||
Encrypt your S3 AWS keys by going to <https://ci.appveyor.com/tools/encrypt> and hitting the `encrypt` button.
|
||||
|
||||
Then paste the result into your `appveyor.yml`
|
||||
|
||||
```yml
|
||||
environment:
|
||||
node_pre_gyp_accessKeyId:
|
||||
secure: Dn9HKdLNYvDgPdQOzRq/DqZ/MPhjknRHB1o+/lVU8MA=
|
||||
node_pre_gyp_secretAccessKey:
|
||||
secure: W1rwNoSnOku1r+28gnoufO8UA8iWADmL1LiiwH9IOkIVhDTNGdGPJqAlLjNqwLnL
|
||||
```
|
||||
|
||||
NOTE: keys are per account but not per repo (this is difference than travis where keys are per repo but not related to the account used to encrypt them).
|
||||
|
||||
#### 5) Hook up publishing
|
||||
|
||||
Just put `node-pre-gyp package publish` in your `appveyor.yml` after `npm install`.
|
||||
|
||||
#### 6) Publish when you want
|
||||
|
||||
You might wish to publish binaries only on a specific commit. To do this you could borrow from the [travis.ci idea of commit keywords](http://about.travis-ci.org/docs/user/how-to-skip-a-build/) and add special handling for commit messages with `[publish binary]`:
|
||||
|
||||
SET CM=%APPVEYOR_REPO_COMMIT_MESSAGE%
|
||||
if not "%CM%" == "%CM:[publish binary]=%" node-pre-gyp --msvs_version=2013 publish
|
||||
|
||||
If your commit message contains special characters (e.g. `&`) this method might fail. An alternative is to use PowerShell, which gives you additional possibilities, like ignoring case by using `ToLower()`:
|
||||
|
||||
ps: if($env:APPVEYOR_REPO_COMMIT_MESSAGE.ToLower().Contains('[publish binary]')) { node-pre-gyp --msvs_version=2013 publish }
|
||||
|
||||
Remember this publishing is not the same as `npm publish`. We're just talking about the binary module here and not your entire npm package. To automate the publishing of your entire package to npm on travis see http://about.travis-ci.org/docs/user/deployment/npm/
|
||||
|
||||
|
||||
## Travis Automation
|
||||
|
||||
[Travis](https://travis-ci.org/) can push to S3 after a successful build and supports both:
|
||||
|
||||
- Ubuntu Precise and OS X (64 bit)
|
||||
- Multiple Node.js versions
|
||||
|
||||
For an example of doing this see [node-add-example's .travis.yml](https://github.com/springmeyer/node-addon-example/blob/2ff60a8ded7f042864ad21db00c3a5a06cf47075/.travis.yml).
|
||||
|
||||
Note: if you need 32 bit binaries, this can be done from a 64 bit travis machine. See [the node-sqlite3 scripts for an example of doing this](https://github.com/mapbox/node-sqlite3/blob/bae122aa6a2b8a45f6b717fab24e207740e32b5d/scripts/build_against_node.sh#L54-L74).
|
||||
|
||||
Below is a guide to getting set up:
|
||||
|
||||
#### 1) Install the travis gem
|
||||
|
||||
gem install travis
|
||||
|
||||
#### 2) Create secure variables
|
||||
|
||||
Make sure you run this command from within the directory of your module.
|
||||
|
||||
Use `travis-encrypt` like:
|
||||
|
||||
travis encrypt node_pre_gyp_accessKeyId=${node_pre_gyp_accessKeyId}
|
||||
travis encrypt node_pre_gyp_secretAccessKey=${node_pre_gyp_secretAccessKey}
|
||||
|
||||
Then put those values in your `.travis.yml` like:
|
||||
|
||||
```yaml
|
||||
env:
|
||||
global:
|
||||
- secure: F+sEL/v56CzHqmCSSES4pEyC9NeQlkoR0Gs/ZuZxX1ytrj8SKtp3MKqBj7zhIclSdXBz4Ev966Da5ctmcTd410p0b240MV6BVOkLUtkjZJyErMBOkeb8n8yVfSoeMx8RiIhBmIvEn+rlQq+bSFis61/JkE9rxsjkGRZi14hHr4M=
|
||||
- secure: o2nkUQIiABD139XS6L8pxq3XO5gch27hvm/gOdV+dzNKc/s2KomVPWcOyXNxtJGhtecAkABzaW8KHDDi5QL1kNEFx6BxFVMLO8rjFPsMVaBG9Ks6JiDQkkmrGNcnVdxI/6EKTLHTH5WLsz8+J7caDBzvKbEfTux5EamEhxIWgrI=
|
||||
```
|
||||
|
||||
More details on travis encryption at http://about.travis-ci.org/docs/user/encryption-keys/.
|
||||
|
||||
#### 3) Hook up publishing
|
||||
|
||||
Just put `node-pre-gyp package publish` in your `.travis.yml` after `npm install`.
|
||||
|
||||
##### OS X publishing
|
||||
|
||||
If you want binaries for OS X in addition to linux you have two options:
|
||||
|
||||
1) [Enabling multi-OS](#enabling-multi-os)
|
||||
|
||||
2) [Using `language: objective-c` in a git branch](#using-language-objective-c).
|
||||
|
||||
##### Enabling multi-OS
|
||||
|
||||
This requires emailing a request to `support@travis-ci.com` for each repo you wish to have enabled. More details at <http://docs.travis-ci.com/user/multi-os/>.
|
||||
|
||||
Next you need to tweak the `.travis.yml` to ensure it is cross platform.
|
||||
|
||||
Use a configuration like:
|
||||
|
||||
```yml
|
||||
|
||||
language: cpp
|
||||
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
|
||||
env:
|
||||
matrix:
|
||||
- NODE_VERSION="0.10"
|
||||
- NODE_VERSION="0.11.14"
|
||||
|
||||
before_install:
|
||||
- rm -rf ~/.nvm/ && git clone --depth 1 https://github.com/creationix/nvm.git ~/.nvm
|
||||
- source ~/.nvm/nvm.sh
|
||||
- nvm install $NODE_VERSION
|
||||
- nvm use $NODE_VERSION
|
||||
```
|
||||
|
||||
See [Travis OS X Gochas](#travis-os-x-gochas) for why we replace `language: node_js` and `node_js:` sections with `language: cpp` and a custom matrix.
|
||||
|
||||
|
||||
Also create platform specific sections for any deps that need install. For example if you need libpng:
|
||||
|
||||
```yml
|
||||
- if [ $(uname -s) == 'Linux' ]; then apt-get install libpng-dev; fi;
|
||||
- if [ $(uname -s) == 'Darwin' ]; then brew install libpng; fi;
|
||||
```
|
||||
|
||||
For detailed multi-OS examples see [node-mapnik](https://github.com/mapnik/node-mapnik/blob/master/.travis.yml) and [node-sqlite3](https://github.com/mapbox/node-sqlite3/blob/master/.travis.yml).
|
||||
|
||||
##### Using `language: objective-c`
|
||||
|
||||
If your repo does not have multi-OS enabled, an alternative method for building for OS X is to tweak your `.travis.yml` to use:
|
||||
|
||||
```yml
|
||||
language: objective-c
|
||||
```
|
||||
|
||||
Keep that change in a different git branch and sync that when you want binaries published.
|
||||
|
||||
Next learn about a few [Travis OS X Gochas](#travis-os-x-gochas).
|
||||
|
||||
##### Travis OS X Gochas
|
||||
|
||||
First, unlike the Travis linux machines the OS X machines do not put `node-pre-gyp` on PATH by default. So to you will need to:
|
||||
|
||||
```sh
|
||||
export PATH=$(pwd)/node_modules/.bin:${PATH}
|
||||
```
|
||||
|
||||
Second, the OS X machines doe not support using a matrix for installing node.js different versions. So you need to bootstrap the installation of node.js in a cross platform way.
|
||||
|
||||
By doing:
|
||||
|
||||
```yml
|
||||
env:
|
||||
matrix:
|
||||
- NODE_VERSION="0.10"
|
||||
- NODE_VERSION="0.11.14"
|
||||
|
||||
before_install:
|
||||
- rm -rf ~/.nvm/ && git clone --depth 1 https://github.com/creationix/nvm.git ~/.nvm
|
||||
- source ~/.nvm/nvm.sh
|
||||
- nvm install $NODE_VERSION
|
||||
- nvm use $NODE_VERSION
|
||||
```
|
||||
|
||||
You can easily recreate the previous behavior of this matrix:
|
||||
|
||||
```yml
|
||||
node_js:
|
||||
- "0.10"
|
||||
- "0.11.14"
|
||||
```
|
||||
|
||||
#### 4) Publish when you want
|
||||
|
||||
You might wish to publish binaries only on a specific commit. To do this you could borrow from the [travis.ci idea of commit keywords](http://about.travis-ci.org/docs/user/how-to-skip-a-build/) and add special handling for commit messages with `[publish binary]`:
|
||||
|
||||
COMMIT_MESSAGE=$(git show -s --format=%B $TRAVIS_COMMIT | tr -d '\n')
|
||||
if [[ ${COMMIT_MESSAGE} =~ "[publish binary]" ]]; then node-pre-gyp publish; fi;
|
||||
|
||||
Then you can trigger new binaries to be built like:
|
||||
|
||||
git commit -a -m "[publish binary]"
|
||||
|
||||
Or, if you don't have any changes to make simply run:
|
||||
|
||||
git commit --allow-empty -m "[publish binary]"
|
||||
|
||||
Remember this publishing is not the same as `npm publish`. We're just talking about the binary module here and not your entire npm package. To automate the publishing of your entire package to npm on travis see http://about.travis-ci.org/docs/user/deployment/npm/
|
||||
|
||||
# Versioning
|
||||
|
||||
The `binary` properties of `module_path`, `remote_path`, and `package_name` support variable substitution. The strings are evaluated by `node-pre-gyp` depending on your system and any custom build flags you passed.
|
||||
|
||||
- `node_abi`: The node C++ `ABI` number. This value is available in Javascript as `process.versions.modules` as of [`>= v0.10.4 >= v0.11.7`](https://github.com/joyent/node/commit/ccabd4a6fa8a6eb79d29bc3bbe9fe2b6531c2d8e) and in C++ as the `NODE_MODULE_VERSION` define much earlier. For versions of Node before this was available we fallback to the V8 major and minor version.
|
||||
- `platform` matches node's `process.platform` like `linux`, `darwin`, and `win32` unless the user passed the `--target_platform` option to override.
|
||||
- `arch` matches node's `process.arch` like `x64` or `ia32` unless the user passes the `--target_arch` option to override.
|
||||
- `configuration` - Either 'Release' or 'Debug' depending on if `--debug` is passed during the build.
|
||||
- `module_name` - the `binary.module_name` attribute from `package.json`.
|
||||
- `version` - the semver `version` value for your module from `package.json` (NOTE: ignores the `semver.build` property).
|
||||
- `major`, `minor`, `patch`, and `prelease` match the individual semver values for your module's `version`
|
||||
- `build` - the sevmer `build` value. For example it would be `this.that` if your package.json `version` was `v1.0.0+this.that`
|
||||
- `prerelease` - the semver `prerelease` value. For example it would be `alpha.beta` if your package.json `version` was `v1.0.0-alpha.beta`
|
||||
|
||||
|
||||
The options are visible in the code at <https://github.com/mapbox/node-pre-gyp/blob/612b7bca2604508d881e1187614870ba19a7f0c5/lib/util/versioning.js#L114-L127>
|
||||
30
node_modules/sqlite3/node_modules/node-pre-gyp/appveyor.yml
generated
vendored
Normal file
30
node_modules/sqlite3/node_modules/node-pre-gyp/appveyor.yml
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
environment:
|
||||
matrix:
|
||||
- nodejs_version: 0.10.36
|
||||
- nodejs_version: 0.12.0
|
||||
- nodejs_version: 1.2.0
|
||||
|
||||
platform:
|
||||
- x64
|
||||
- x86
|
||||
|
||||
shallow_clone: true
|
||||
|
||||
install:
|
||||
- ps: Install-Product node $env:nodejs_version $env:Platform
|
||||
- node --version
|
||||
- npm --version
|
||||
- SET PATH=%APPDATA%\npm;%PATH%
|
||||
- npm update -g npm
|
||||
- npm --version
|
||||
- node -e "console.log(process.arch);"
|
||||
- SET PATH=C:\Program Files (x86)\MSBuild\12.0\bin\;%PATH%
|
||||
- if "%PLATFORM%" == "x64" set PATH=C:\Python27-x64;%PATH%
|
||||
- if "%PLATFORM%" == "x86" SET PATH=C:\python27;%PATH%
|
||||
- npm install
|
||||
- npm test
|
||||
- .\scripts\test.bat
|
||||
|
||||
build: off
|
||||
test: off
|
||||
deploy: off
|
||||
131
node_modules/sqlite3/node_modules/node-pre-gyp/bin/node-pre-gyp
generated
vendored
Normal file
131
node_modules/sqlite3/node_modules/node-pre-gyp/bin/node-pre-gyp
generated
vendored
Normal file
@@ -0,0 +1,131 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Set the title.
|
||||
*/
|
||||
|
||||
process.title = 'node-pre-gyp';
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
*/
|
||||
|
||||
var node_pre_gyp = require('../');
|
||||
var log = require('npmlog');
|
||||
|
||||
/**
|
||||
* Process and execute the selected commands.
|
||||
*/
|
||||
|
||||
var prog = new node_pre_gyp.Run();
|
||||
var completed = false;
|
||||
prog.parseArgv(process.argv);
|
||||
|
||||
if (prog.todo.length === 0) {
|
||||
if (~process.argv.indexOf('-v') || ~process.argv.indexOf('--version')) {
|
||||
console.log('v%s', prog.version);
|
||||
} else {
|
||||
console.log('%s', prog.usage());
|
||||
}
|
||||
return process.exit(0);
|
||||
}
|
||||
|
||||
// if --no-color is passed
|
||||
if (prog.opts && prog.opts.hasOwnProperty('color') && !prog.opts.color) {
|
||||
log.disableColor();
|
||||
}
|
||||
|
||||
log.info('it worked if it ends with', 'ok');
|
||||
log.verbose('cli', process.argv);
|
||||
log.info('using', process.title + '@%s', prog.version);
|
||||
log.info('using', 'node@%s | %s | %s', process.versions.node, process.platform, process.arch);
|
||||
|
||||
|
||||
/**
|
||||
* Change dir if -C/--directory was passed.
|
||||
*/
|
||||
|
||||
var dir = prog.opts.directory;
|
||||
if (dir) {
|
||||
var fs = require('fs');
|
||||
try {
|
||||
var stat = fs.statSync(dir);
|
||||
if (stat.isDirectory()) {
|
||||
log.info('chdir', dir);
|
||||
process.chdir(dir);
|
||||
} else {
|
||||
log.warn('chdir', dir + ' is not a directory');
|
||||
}
|
||||
} catch (e) {
|
||||
if (e.code === 'ENOENT') {
|
||||
log.warn('chdir', dir + ' is not a directory');
|
||||
} else {
|
||||
log.warn('chdir', 'error during chdir() "%s"', e.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function run () {
|
||||
var command = prog.todo.shift();
|
||||
if (!command) {
|
||||
// done!
|
||||
completed = true;
|
||||
log.info('ok');
|
||||
return;
|
||||
}
|
||||
|
||||
prog.commands[command.name](command.args, function (err) {
|
||||
if (err) {
|
||||
log.error(command.name + ' error');
|
||||
log.error('stack', err.stack);
|
||||
errorMessage();
|
||||
log.error('not ok');
|
||||
console.log(err.message);
|
||||
return process.exit(1);
|
||||
}
|
||||
var args_array = [].slice.call(arguments, 1);
|
||||
if (args_array.length) {
|
||||
console.log.apply(console, args_array);
|
||||
}
|
||||
// now run the next command in the queue
|
||||
process.nextTick(run);
|
||||
});
|
||||
}
|
||||
|
||||
process.on('exit', function (code) {
|
||||
if (!completed && !code) {
|
||||
log.error('Completion callback never invoked!');
|
||||
issueMessage();
|
||||
process.exit(6);
|
||||
}
|
||||
});
|
||||
|
||||
process.on('uncaughtException', function (err) {
|
||||
log.error('UNCAUGHT EXCEPTION');
|
||||
log.error('stack', err.stack);
|
||||
issueMessage();
|
||||
process.exit(7);
|
||||
});
|
||||
|
||||
function errorMessage () {
|
||||
// copied from npm's lib/util/error-handler.js
|
||||
var os = require('os');
|
||||
log.error('System', os.type() + ' ' + os.release());
|
||||
log.error('command', process.argv.map(JSON.stringify).join(' '));
|
||||
log.error('cwd', process.cwd());
|
||||
log.error('node -v', process.version);
|
||||
log.error(process.title+' -v', 'v' + prog.package.version);
|
||||
}
|
||||
|
||||
function issueMessage () {
|
||||
errorMessage();
|
||||
log.error('', [ 'This is a bug in `'+process.title+'`.',
|
||||
'Try to update '+process.title+' and file an issue if it does not help:',
|
||||
' <https://github.com/mapbox/'+process.title+'/issues>',
|
||||
].join('\n'));
|
||||
}
|
||||
|
||||
// start running the given commands!
|
||||
run();
|
||||
2
node_modules/sqlite3/node_modules/node-pre-gyp/bin/node-pre-gyp.cmd
generated
vendored
Normal file
2
node_modules/sqlite3/node_modules/node-pre-gyp/bin/node-pre-gyp.cmd
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
@echo off
|
||||
node "%~dp0\node-pre-gyp" %*
|
||||
43
node_modules/sqlite3/node_modules/node-pre-gyp/lib/build.js
generated
vendored
Normal file
43
node_modules/sqlite3/node_modules/node-pre-gyp/lib/build.js
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = exports = build;
|
||||
|
||||
exports.usage = 'Attempts to compile the module by dispatching to node-gyp or nw-gyp';
|
||||
|
||||
var compile = require('./util/compile.js');
|
||||
var handle_gyp_opts = require('./util/handle_gyp_opts.js');
|
||||
var configure = require('./configure.js');
|
||||
|
||||
function do_build(gyp,argv,callback) {
|
||||
handle_gyp_opts(gyp,argv,function(err,result) {
|
||||
var final_args = ['build'].concat(result.gyp).concat(result.pre);
|
||||
if (result.unparsed.length > 0) {
|
||||
final_args = final_args.
|
||||
concat(['--']).
|
||||
concat(result.unparsed);
|
||||
}
|
||||
compile.run_gyp(final_args,result.opts,function(err) {
|
||||
return callback(err);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function build(gyp, argv, callback) {
|
||||
|
||||
// Form up commands to pass to node-gyp:
|
||||
// We map `node-pre-gyp build` to `node-gyp configure build` so that we do not
|
||||
// trigger a clean and therefore do not pay the penalty of a full recompile
|
||||
if (argv.length && (argv.indexOf('rebuild') > -1)) {
|
||||
// here we map `node-pre-gyp rebuild` to `node-gyp rebuild` which internally means
|
||||
// "clean + configure + build" and triggers a full recompile
|
||||
compile.run_gyp(['clean'],{},function(err) {
|
||||
if (err) return callback(err);
|
||||
configure(gyp,argv,function(err) {
|
||||
if (err) return callback(err);
|
||||
return do_build(gyp,argv,callback);
|
||||
});
|
||||
});
|
||||
} else {
|
||||
return do_build(gyp,argv,callback);
|
||||
}
|
||||
}
|
||||
23
node_modules/sqlite3/node_modules/node-pre-gyp/lib/clean.js
generated
vendored
Normal file
23
node_modules/sqlite3/node_modules/node-pre-gyp/lib/clean.js
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = exports = clean;
|
||||
|
||||
exports.usage = 'Removes the entire folder containing the compiled .node module';
|
||||
|
||||
var fs = require('fs');
|
||||
var rm = require('rimraf');
|
||||
var exists = require('fs').exists || require('path').exists;
|
||||
var versioning = require('./util/versioning.js');
|
||||
|
||||
function clean (gyp, argv, callback) {
|
||||
var package_json = JSON.parse(fs.readFileSync('./package.json'));
|
||||
var opts = versioning.evaluate(package_json, gyp.opts);
|
||||
var to_delete = opts.module_path;
|
||||
exists(to_delete, function(found) {
|
||||
if (found) {
|
||||
if (!gyp.opts.silent_clean) console.log('['+package_json.name+'] Removing "%s"', to_delete);
|
||||
return rm(to_delete, callback);
|
||||
}
|
||||
return callback();
|
||||
});
|
||||
}
|
||||
48
node_modules/sqlite3/node_modules/node-pre-gyp/lib/configure.js
generated
vendored
Normal file
48
node_modules/sqlite3/node_modules/node-pre-gyp/lib/configure.js
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = exports = configure;
|
||||
|
||||
exports.usage = 'Attempts to configure node-gyp or nw-gyp build';
|
||||
|
||||
var compile = require('./util/compile.js');
|
||||
var handle_gyp_opts = require('./util/handle_gyp_opts.js');
|
||||
|
||||
function configure(gyp, argv, callback) {
|
||||
handle_gyp_opts(gyp,argv,function(err,result) {
|
||||
var final_args = result.gyp.concat(result.pre);
|
||||
// pull select node-gyp configure options out of the npm environ
|
||||
var known_gyp_args = ['dist-url','python','nodedir','msvs_version'];
|
||||
known_gyp_args.forEach(function(key) {
|
||||
var val = gyp.opts[key] || gyp.opts[key.replace('-','_')];
|
||||
if (val) {
|
||||
final_args.push('--'+key+'='+val);
|
||||
}
|
||||
});
|
||||
// --ensure=false tell node-gyp to re-install node development headers
|
||||
// but it is only respected by node-gyp install, so we have to call install
|
||||
// as a separate step if the user passes it
|
||||
if (gyp.opts.ensure === false) {
|
||||
var install_args = final_args.concat(['install','--ensure=false']);
|
||||
compile.run_gyp(install_args,result.opts,function(err) {
|
||||
if (err) return callback(err);
|
||||
if (result.unparsed.length > 0) {
|
||||
final_args = final_args.
|
||||
concat(['--']).
|
||||
concat(result.unparsed);
|
||||
}
|
||||
compile.run_gyp(['configure'].concat(final_args),result.opts,function(err) {
|
||||
return callback(err);
|
||||
});
|
||||
});
|
||||
} else {
|
||||
if (result.unparsed.length > 0) {
|
||||
final_args = final_args.
|
||||
concat(['--']).
|
||||
concat(result.unparsed);
|
||||
}
|
||||
compile.run_gyp(['configure'].concat(final_args),result.opts,function(err) {
|
||||
return callback(err);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
40
node_modules/sqlite3/node_modules/node-pre-gyp/lib/info.js
generated
vendored
Normal file
40
node_modules/sqlite3/node_modules/node-pre-gyp/lib/info.js
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = exports = unpublish;
|
||||
|
||||
exports.usage = 'Lists all published binaries (requires aws-sdk)';
|
||||
|
||||
var fs = require('fs');
|
||||
var log = require('npmlog');
|
||||
var versioning = require('./util/versioning.js');
|
||||
var s3_setup = require('./util/s3_setup.js');
|
||||
var config = require('rc')("node_pre_gyp",{acl:"public-read"});
|
||||
|
||||
function unpublish(gyp, argv, callback) {
|
||||
var AWS = require("aws-sdk");
|
||||
var package_json = JSON.parse(fs.readFileSync('./package.json'));
|
||||
var opts = versioning.evaluate(package_json, gyp.opts);
|
||||
s3_setup.detect(opts.hosted_path,config);
|
||||
AWS.config.update(config);
|
||||
var s3 = new AWS.S3();
|
||||
var s3_opts = { Bucket: config.bucket,
|
||||
Prefix: config.prefix
|
||||
};
|
||||
s3.listObjects(s3_opts, function(err, meta){
|
||||
if (err && err.code == 'NotFound') {
|
||||
return callback(new Error('['+package_json.name+'] Not found: https://' + s3_opts.Bucket + '.s3.amazonaws.com/'+config.prefix));
|
||||
} else if(err) {
|
||||
return callback(err);
|
||||
} else {
|
||||
log.verbose(JSON.stringify(meta,null,1));
|
||||
if (meta && meta.Contents) {
|
||||
meta.Contents.forEach(function(obj) {
|
||||
console.log(obj.Key);
|
||||
});
|
||||
} else {
|
||||
console.error('['+package_json.name+'] No objects found at https://' + s3_opts.Bucket + '.s3.amazonaws.com/'+config.prefix );
|
||||
}
|
||||
return callback();
|
||||
}
|
||||
});
|
||||
}
|
||||
205
node_modules/sqlite3/node_modules/node-pre-gyp/lib/install.js
generated
vendored
Normal file
205
node_modules/sqlite3/node_modules/node-pre-gyp/lib/install.js
generated
vendored
Normal file
@@ -0,0 +1,205 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = exports = install;
|
||||
|
||||
exports.usage = 'Attempts to install pre-built binary for module';
|
||||
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
var zlib = require('zlib');
|
||||
var log = require('npmlog');
|
||||
var existsAsync = fs.exists || path.exists;
|
||||
var versioning = require('./util/versioning.js');
|
||||
var testbinary = require('./testbinary.js');
|
||||
var clean = require('./clean.js');
|
||||
|
||||
function download(uri,opts,callback) {
|
||||
log.http('GET', uri);
|
||||
|
||||
var req = null;
|
||||
var requestOpts = {
|
||||
uri: uri.replace('+','%2B'),
|
||||
headers: {
|
||||
'User-Agent': 'node-pre-gyp (node ' + process.version + ')'
|
||||
}
|
||||
};
|
||||
|
||||
var proxyUrl = opts.proxy ||
|
||||
process.env.http_proxy ||
|
||||
process.env.HTTP_PROXY ||
|
||||
process.env.npm_config_proxy;
|
||||
if (proxyUrl) {
|
||||
if (/^https?:\/\//i.test(proxyUrl)) {
|
||||
log.verbose('download', 'using proxy url: "%s"', proxyUrl);
|
||||
requestOpts.proxy = proxyUrl;
|
||||
} else {
|
||||
log.warn('download', 'ignoring invalid "proxy" config setting: "%s"', proxyUrl);
|
||||
}
|
||||
}
|
||||
try {
|
||||
req = require('request')(requestOpts);
|
||||
} catch (e) {
|
||||
return callback(e);
|
||||
}
|
||||
if (req) {
|
||||
req.on('response', function (res) {
|
||||
log.http(res.statusCode, uri);
|
||||
});
|
||||
}
|
||||
return callback(null,req);
|
||||
}
|
||||
|
||||
function place_binary(from,to,opts,callback) {
|
||||
download(from,opts,function(err,req) {
|
||||
if (err) return callback(err);
|
||||
if (!req) return callback(new Error("empty req"));
|
||||
var badDownload = false;
|
||||
var extractCount = 0;
|
||||
var gunzip = zlib.createGunzip();
|
||||
var extracter = require('tar').Extract({ path: to, strip: 1});
|
||||
|
||||
function afterTarball(err) {
|
||||
if (err) return callback(err);
|
||||
if (badDownload) return callback(new Error("bad download"));
|
||||
if (extractCount === 0) {
|
||||
return callback(new Error('There was a fatal problem while downloading/extracting the tarball'));
|
||||
}
|
||||
log.info('tarball', 'done parsing tarball');
|
||||
callback();
|
||||
}
|
||||
|
||||
function filter_func(entry) {
|
||||
// ensure directories are +x
|
||||
// https://github.com/mapnik/node-mapnik/issues/262
|
||||
entry.props.mode |= (entry.props.mode >>> 2) & parseInt('0111',8);
|
||||
log.info('install','unpacking ' + entry.path);
|
||||
extractCount++;
|
||||
}
|
||||
|
||||
gunzip.on('error', callback);
|
||||
extracter.on('entry', filter_func);
|
||||
extracter.on('error', callback);
|
||||
extracter.on('end', afterTarball);
|
||||
|
||||
req.on('error', function(err) {
|
||||
badDownload = true;
|
||||
return callback(err);
|
||||
});
|
||||
|
||||
req.on('close', function () {
|
||||
if (extractCount === 0) {
|
||||
return callback(new Error('Connection closed while downloading tarball file'));
|
||||
}
|
||||
});
|
||||
|
||||
req.on('response', function(res) {
|
||||
if (res.statusCode !== 200) {
|
||||
badDownload = true;
|
||||
if (res.statusCode == 404) {
|
||||
return callback(new Error('Pre-built binary not available for your system, looked for ' + from));
|
||||
} else {
|
||||
return callback(new Error(res.statusCode + ' status code downloading tarball ' + from));
|
||||
}
|
||||
}
|
||||
// start unzipping and untaring
|
||||
req.pipe(gunzip).pipe(extracter);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function do_build(gyp,argv,callback) {
|
||||
gyp.todo.push( { name: 'build', args: ['rebuild'] } );
|
||||
process.nextTick(callback);
|
||||
}
|
||||
|
||||
function install(gyp, argv, callback) {
|
||||
var package_json = JSON.parse(fs.readFileSync('./package.json'));
|
||||
var source_build = gyp.opts['build-from-source'] || gyp.opts.build_from_source;
|
||||
var update_binary = gyp.opts['update-binary'] || gyp.opts.update_binary;
|
||||
var should_do_source_build = source_build === package_json.name || (source_build === true || source_build === 'true');
|
||||
var no_rollback = gyp.opts.hasOwnProperty('rollback') && gyp.opts.rollback === false;
|
||||
if (should_do_source_build) {
|
||||
log.info('build','requesting source compile');
|
||||
return do_build(gyp,argv,callback);
|
||||
} else {
|
||||
var fallback_to_build = gyp.opts['fallback-to-build'] || gyp.opts.fallback_to_build;
|
||||
var should_do_fallback_build = fallback_to_build === package_json.name || (fallback_to_build === true || fallback_to_build === 'true');
|
||||
// but allow override from npm
|
||||
if (process.env.npm_config_argv) {
|
||||
var cooked = JSON.parse(process.env.npm_config_argv).cooked;
|
||||
var match = cooked.indexOf("--fallback-to-build");
|
||||
if (match > -1 && cooked.length > match && cooked[match+1] == "false") {
|
||||
should_do_fallback_build = false;
|
||||
log.info('install','Build fallback disabled via npm flag: --fallback-to-build=false');
|
||||
}
|
||||
}
|
||||
var opts;
|
||||
try {
|
||||
opts = versioning.evaluate(package_json, gyp.opts);
|
||||
} catch (err) {
|
||||
return callback(err);
|
||||
}
|
||||
var from = opts.hosted_tarball;
|
||||
var to = opts.module_path;
|
||||
var binary_module = path.join(to,opts.module_name + '.node');
|
||||
if (existsAsync(binary_module,function(found) {
|
||||
if (found && !update_binary) {
|
||||
testbinary(gyp, argv, function(err) {
|
||||
if (err) {
|
||||
console.error('['+package_json.name+'] ' + err.message);
|
||||
log.error("Testing local pre-built binary failed, attempting to re-download");
|
||||
place_binary(from,to,opts,function(err) {
|
||||
if (err) {
|
||||
if (should_do_fallback_build) {
|
||||
log.http(err.message + ' (falling back to source compile with node-gyp)');
|
||||
return do_build(gyp,argv,callback);
|
||||
} else {
|
||||
return callback(err);
|
||||
}
|
||||
} else {
|
||||
console.log('['+package_json.name+'] Success: "' + binary_module + '" is reinstalled via remote');
|
||||
return callback();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
console.log('['+package_json.name+'] Success: "' + binary_module + '" already installed');
|
||||
console.log('Pass --update-binary to reinstall or --build-from-source to recompile');
|
||||
return callback();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (!update_binary) log.info('check','checked for "' + binary_module + '" (not found)');
|
||||
place_binary(from,to,opts,function(err) {
|
||||
if (err && should_do_fallback_build) {
|
||||
log.http(err.message + ' (falling back to source compile with node-gyp)');
|
||||
return do_build(gyp,argv,callback);
|
||||
} else if (err) {
|
||||
return callback(err);
|
||||
} else {
|
||||
testbinary(gyp, argv, function(err) {
|
||||
if (err) {
|
||||
if (no_rollback) {
|
||||
return callback(err);
|
||||
}
|
||||
gyp.opts.silent_clean = true;
|
||||
clean(gyp, argv, function(error) {
|
||||
if (error) console.log(error);
|
||||
if (should_do_fallback_build) {
|
||||
console.error('['+package_json.name+'] ' + err.message);
|
||||
log.error("Testing pre-built binary failed, attempting to source compile");
|
||||
return do_build(gyp,argv,callback);
|
||||
} else {
|
||||
return callback(err);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
console.log('['+package_json.name+'] Success: "' + binary_module + '" is installed via remote');
|
||||
return callback();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}));
|
||||
}
|
||||
}
|
||||
192
node_modules/sqlite3/node_modules/node-pre-gyp/lib/node-pre-gyp.js
generated
vendored
Normal file
192
node_modules/sqlite3/node_modules/node-pre-gyp/lib/node-pre-gyp.js
generated
vendored
Normal file
@@ -0,0 +1,192 @@
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
*/
|
||||
|
||||
module.exports = exports;
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
*/
|
||||
|
||||
var path = require('path');
|
||||
var nopt = require('nopt');
|
||||
var log = require('npmlog');
|
||||
var EE = require('events').EventEmitter;
|
||||
var inherits = require('util').inherits;
|
||||
var commands = [
|
||||
'clean',
|
||||
'install',
|
||||
'reinstall',
|
||||
'build',
|
||||
'rebuild',
|
||||
'package',
|
||||
'testpackage',
|
||||
'publish',
|
||||
'unpublish',
|
||||
'info',
|
||||
'testbinary',
|
||||
'reveal',
|
||||
'configure'
|
||||
];
|
||||
var aliases = {};
|
||||
|
||||
// differentiate node-pre-gyp's logs from npm's
|
||||
log.heading = 'node-pre-gyp';
|
||||
|
||||
exports.find = require('./pre-binding').find;
|
||||
|
||||
function Run() {
|
||||
var self = this;
|
||||
|
||||
this.commands = {};
|
||||
|
||||
commands.forEach(function (command) {
|
||||
self.commands[command] = function (argv, callback) {
|
||||
log.verbose('command', command, argv);
|
||||
return require('./' + command)(self, argv, callback);
|
||||
};
|
||||
});
|
||||
}
|
||||
inherits(Run, EE);
|
||||
exports.Run = Run;
|
||||
var proto = Run.prototype;
|
||||
|
||||
/**
|
||||
* Export the contents of the package.json.
|
||||
*/
|
||||
|
||||
proto.package = require('../package');
|
||||
|
||||
/**
|
||||
* nopt configuration definitions
|
||||
*/
|
||||
|
||||
proto.configDefs = {
|
||||
help: Boolean, // everywhere
|
||||
arch: String, // 'configure'
|
||||
debug: Boolean, // 'build'
|
||||
directory: String, // bin
|
||||
proxy: String, // 'install'
|
||||
loglevel: String, // everywhere
|
||||
};
|
||||
|
||||
/**
|
||||
* nopt shorthands
|
||||
*/
|
||||
|
||||
proto.shorthands = {
|
||||
release: '--no-debug',
|
||||
C: '--directory',
|
||||
debug: '--debug',
|
||||
j: '--jobs',
|
||||
silent: '--loglevel=silent',
|
||||
silly: '--loglevel=silly',
|
||||
verbose: '--loglevel=verbose',
|
||||
};
|
||||
|
||||
/**
|
||||
* expose the command aliases for the bin file to use.
|
||||
*/
|
||||
|
||||
proto.aliases = aliases;
|
||||
|
||||
/**
|
||||
* Parses the given argv array and sets the 'opts',
|
||||
* 'argv' and 'command' properties.
|
||||
*/
|
||||
|
||||
proto.parseArgv = function parseOpts (argv) {
|
||||
this.opts = nopt(this.configDefs, this.shorthands, argv);
|
||||
this.argv = this.opts.argv.remain.slice();
|
||||
var commands = this.todo = [];
|
||||
|
||||
// create a copy of the argv array with aliases mapped
|
||||
argv = this.argv.map(function (arg) {
|
||||
// is this an alias?
|
||||
if (arg in this.aliases) {
|
||||
arg = this.aliases[arg];
|
||||
}
|
||||
return arg;
|
||||
}, this);
|
||||
|
||||
// process the mapped args into "command" objects ("name" and "args" props)
|
||||
argv.slice().forEach(function (arg) {
|
||||
if (arg in this.commands) {
|
||||
var args = argv.splice(0, argv.indexOf(arg));
|
||||
argv.shift();
|
||||
if (commands.length > 0) {
|
||||
commands[commands.length - 1].args = args;
|
||||
}
|
||||
commands.push({ name: arg, args: [] });
|
||||
}
|
||||
}, this);
|
||||
if (commands.length > 0) {
|
||||
commands[commands.length - 1].args = argv.splice(0);
|
||||
}
|
||||
|
||||
// support for inheriting config env variables from npm
|
||||
var npm_config_prefix = 'npm_config_';
|
||||
Object.keys(process.env).forEach(function (name) {
|
||||
if (name.indexOf(npm_config_prefix) !== 0) return;
|
||||
var val = process.env[name];
|
||||
if (name === npm_config_prefix + 'loglevel') {
|
||||
log.level = val;
|
||||
} else {
|
||||
// add the user-defined options to the config
|
||||
name = name.substring(npm_config_prefix.length);
|
||||
// avoid npm argv clobber already present args
|
||||
// which avoids problem of 'npm test' calling
|
||||
// script that runs unique npm install commands
|
||||
if (name === 'argv') {
|
||||
if (this.opts.argv &&
|
||||
this.opts.argv.remain &&
|
||||
this.opts.argv.remain.length) {
|
||||
// do nothing
|
||||
} else {
|
||||
this.opts[name] = val;
|
||||
}
|
||||
} else {
|
||||
this.opts[name] = val;
|
||||
}
|
||||
}
|
||||
}, this);
|
||||
|
||||
if (this.opts.loglevel) {
|
||||
log.level = this.opts.loglevel;
|
||||
}
|
||||
log.resume();
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the usage instructions for node-pre-gyp.
|
||||
*/
|
||||
|
||||
proto.usage = function usage () {
|
||||
var str = [
|
||||
'',
|
||||
' Usage: node-pre-gyp <command> [options]',
|
||||
'',
|
||||
' where <command> is one of:',
|
||||
commands.map(function (c) {
|
||||
return ' - ' + c + ' - ' + require('./' + c).usage;
|
||||
}).join('\n'),
|
||||
'',
|
||||
'node-pre-gyp@' + this.version + ' ' + path.resolve(__dirname, '..'),
|
||||
'node@' + process.versions.node
|
||||
].join('\n');
|
||||
return str;
|
||||
};
|
||||
|
||||
/**
|
||||
* Version number getter.
|
||||
*/
|
||||
|
||||
Object.defineProperty(proto, 'version', {
|
||||
get: function () {
|
||||
return this.package.version;
|
||||
},
|
||||
enumerable: true
|
||||
});
|
||||
|
||||
46
node_modules/sqlite3/node_modules/node-pre-gyp/lib/package.js
generated
vendored
Normal file
46
node_modules/sqlite3/node_modules/node-pre-gyp/lib/package.js
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = exports = _package;
|
||||
|
||||
exports.usage = 'Packs binary (and enclosing directory) into locally staged tarball';
|
||||
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
var log = require('npmlog');
|
||||
var versioning = require('./util/versioning.js');
|
||||
var write = require('fs').createWriteStream;
|
||||
var existsAsync = fs.exists || path.exists;
|
||||
var mkdirp = require('mkdirp');
|
||||
|
||||
function _package(gyp, argv, callback) {
|
||||
var pack = require('tar-pack').pack;
|
||||
var package_json = JSON.parse(fs.readFileSync('./package.json'));
|
||||
var opts = versioning.evaluate(package_json, gyp.opts);
|
||||
var from = opts.module_path;
|
||||
var binary_module = path.join(from,opts.module_name + '.node');
|
||||
existsAsync(binary_module,function(found) {
|
||||
if (!found) {
|
||||
return callback(new Error("Cannot package because " + binary_module + " missing: run `node-pre-gyp rebuild` first"));
|
||||
}
|
||||
var tarball = opts.staged_tarball;
|
||||
var filter_func = function(entry) {
|
||||
// ensure directories are +x
|
||||
// https://github.com/mapnik/node-mapnik/issues/262
|
||||
log.info('package','packing ' + entry.path);
|
||||
return true;
|
||||
};
|
||||
mkdirp(path.dirname(tarball),function(err) {
|
||||
if (err) throw err;
|
||||
pack(from, { filter: filter_func })
|
||||
.pipe(write(tarball))
|
||||
.on('error', function(err) {
|
||||
if (err) console.error('['+package_json.name+'] ' + err.message);
|
||||
return callback(err);
|
||||
})
|
||||
.on('close', function() {
|
||||
log.info('package','Binary staged at "' + tarball + '"');
|
||||
return callback();
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
25
node_modules/sqlite3/node_modules/node-pre-gyp/lib/pre-binding.js
generated
vendored
Normal file
25
node_modules/sqlite3/node_modules/node-pre-gyp/lib/pre-binding.js
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
"use strict";
|
||||
|
||||
var versioning = require('../lib/util/versioning.js');
|
||||
var existsSync = require('fs').existsSync || require('path').existsSync;
|
||||
var path = require('path');
|
||||
|
||||
module.exports = exports;
|
||||
|
||||
exports.usage = 'Finds the require path for the node-pre-gyp installed module';
|
||||
|
||||
exports.validate = function(package_json) {
|
||||
versioning.validate_config(package_json);
|
||||
};
|
||||
|
||||
exports.find = function(package_json_path,opts) {
|
||||
if (!existsSync(package_json_path)) {
|
||||
throw new Error("package.json does not exist at " + package_json_path);
|
||||
}
|
||||
var package_json = require(package_json_path);
|
||||
versioning.validate_config(package_json);
|
||||
opts = opts || {};
|
||||
if (!opts.module_root) opts.module_root = path.dirname(package_json_path);
|
||||
var meta = versioning.evaluate(package_json,opts);
|
||||
return meta.module;
|
||||
};
|
||||
77
node_modules/sqlite3/node_modules/node-pre-gyp/lib/publish.js
generated
vendored
Normal file
77
node_modules/sqlite3/node_modules/node-pre-gyp/lib/publish.js
generated
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = exports = publish;
|
||||
|
||||
exports.usage = 'Publishes pre-built binary (requires aws-sdk)';
|
||||
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
var log = require('npmlog');
|
||||
var versioning = require('./util/versioning.js');
|
||||
var s3_setup = require('./util/s3_setup.js');
|
||||
var existsAsync = fs.exists || path.exists;
|
||||
var url = require('url');
|
||||
var config = require('rc')("node_pre_gyp",{acl:"public-read"});
|
||||
|
||||
function publish(gyp, argv, callback) {
|
||||
var AWS = require("aws-sdk");
|
||||
var package_json = JSON.parse(fs.readFileSync('./package.json'));
|
||||
var opts = versioning.evaluate(package_json, gyp.opts);
|
||||
var tarball = opts.staged_tarball;
|
||||
existsAsync(tarball,function(found) {
|
||||
if (!found) {
|
||||
return callback(new Error("Cannot publish because " + tarball + " missing: run `node-pre-gyp package` first"));
|
||||
}
|
||||
log.info('publish', 'Detecting s3 credentials');
|
||||
s3_setup.detect(opts.hosted_path,config);
|
||||
var key_name = url.resolve(config.prefix,opts.package_name);
|
||||
log.info('publish', 'Authenticating with s3');
|
||||
AWS.config.update(config);
|
||||
var s3 = new AWS.S3();
|
||||
var s3_opts = { Bucket: config.bucket,
|
||||
Key: key_name
|
||||
};
|
||||
var remote_package = 'https://' + s3_opts.Bucket + '.s3.amazonaws.com/' + s3_opts.Key;
|
||||
log.info('publish', 'Checking for existing binary at ' + remote_package);
|
||||
s3.headObject(s3_opts, function(err, meta){
|
||||
if (meta) log.info('publish', JSON.stringify(meta));
|
||||
if (err && err.code == 'NotFound') {
|
||||
// we are safe to publish because
|
||||
// the object does not already exist
|
||||
log.info('publish', 'Preparing to put object');
|
||||
var s3_put = new AWS.S3();
|
||||
var s3_put_opts = { ACL: config.acl,
|
||||
Body: fs.createReadStream(tarball),
|
||||
Bucket: config.bucket,
|
||||
Key: key_name
|
||||
};
|
||||
log.info('publish', 'Putting object');
|
||||
try {
|
||||
s3_put.putObject(s3_put_opts, function(err, resp){
|
||||
log.info('publish', 'returned from putting object');
|
||||
if(err) {
|
||||
log.info('publish', 's3 putObject error: "' + err + '"');
|
||||
return callback(err);
|
||||
}
|
||||
if (resp) log.info('publish', 's3 putObject response: "' + JSON.stringify(resp) + '"');
|
||||
log.info('publish', 'successfully put object');
|
||||
console.log('['+package_json.name+'] published to ' + remote_package);
|
||||
return callback();
|
||||
});
|
||||
} catch (err) {
|
||||
log.info('publish', 's3 putObject error: "' + err + '"');
|
||||
return callback(err);
|
||||
}
|
||||
} else if (err) {
|
||||
log.info('publish', 's3 headObject error: "' + err + '"');
|
||||
return callback(err);
|
||||
} else {
|
||||
log.error('publish','Cannot publish over existing version');
|
||||
log.error('publish',"Update the 'version' field in package.json and try again");
|
||||
log.error('publish','If the previous version was published in error see:');
|
||||
log.error('publish','\t node-pre-gyp unpublish');
|
||||
return callback(new Error('Failed publishing to ' + remote_package));
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
13
node_modules/sqlite3/node_modules/node-pre-gyp/lib/rebuild.js
generated
vendored
Normal file
13
node_modules/sqlite3/node_modules/node-pre-gyp/lib/rebuild.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = exports = rebuild;
|
||||
|
||||
exports.usage = 'Runs "clean" and "build" at once';
|
||||
|
||||
function rebuild (gyp, argv, callback) {
|
||||
gyp.todo.unshift(
|
||||
{ name: 'clean', args: [] },
|
||||
{ name: 'build', args: ['rebuild'] }
|
||||
);
|
||||
process.nextTick(callback);
|
||||
}
|
||||
13
node_modules/sqlite3/node_modules/node-pre-gyp/lib/reinstall.js
generated
vendored
Normal file
13
node_modules/sqlite3/node_modules/node-pre-gyp/lib/reinstall.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = exports = rebuild;
|
||||
|
||||
exports.usage = 'Runs "clean" and "install" at once';
|
||||
|
||||
function rebuild (gyp, argv, callback) {
|
||||
gyp.todo.unshift(
|
||||
{ name: 'clean', args: [] },
|
||||
{ name: 'install', args: [] }
|
||||
);
|
||||
process.nextTick(callback);
|
||||
}
|
||||
31
node_modules/sqlite3/node_modules/node-pre-gyp/lib/reveal.js
generated
vendored
Normal file
31
node_modules/sqlite3/node_modules/node-pre-gyp/lib/reveal.js
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = exports = reveal;
|
||||
|
||||
exports.usage = 'Reveals data on the versioned binary';
|
||||
|
||||
var fs = require('fs');
|
||||
var versioning = require('./util/versioning.js');
|
||||
|
||||
function unix_paths(key, val) {
|
||||
return val && val.replace ? val.replace(/\\/g, '/') : val;
|
||||
}
|
||||
|
||||
function reveal(gyp, argv, callback) {
|
||||
var package_json = JSON.parse(fs.readFileSync('./package.json'));
|
||||
var opts = versioning.evaluate(package_json, gyp.opts);
|
||||
var hit = false;
|
||||
// if a second arg is passed look to see
|
||||
// if it is a known option
|
||||
//console.log(JSON.stringify(gyp.opts,null,1))
|
||||
var remain = gyp.opts.argv.remain.pop();
|
||||
if (remain && opts.hasOwnProperty(remain)) {
|
||||
console.log(opts[remain].replace(/\\/g, '/'));
|
||||
hit = true;
|
||||
}
|
||||
// otherwise return all options as json
|
||||
if (!hit) {
|
||||
console.log(JSON.stringify(opts,unix_paths,2));
|
||||
}
|
||||
return callback();
|
||||
}
|
||||
73
node_modules/sqlite3/node_modules/node-pre-gyp/lib/testbinary.js
generated
vendored
Normal file
73
node_modules/sqlite3/node_modules/node-pre-gyp/lib/testbinary.js
generated
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = exports = testbinary;
|
||||
|
||||
exports.usage = 'Tests that the binary.node can be required';
|
||||
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
var log = require('npmlog');
|
||||
var cp = require('child_process');
|
||||
var versioning = require('./util/versioning.js');
|
||||
var path = require('path');
|
||||
|
||||
function testbinary(gyp, argv, callback) {
|
||||
var args = [];
|
||||
var options = {};
|
||||
var shell_cmd = process.execPath;
|
||||
var package_json = JSON.parse(fs.readFileSync('./package.json'));
|
||||
var opts = versioning.evaluate(package_json, gyp.opts);
|
||||
// ensure on windows that / are used for require path
|
||||
var binary_module = opts.module.replace(/\\/g, '/');
|
||||
var nw = (opts.runtime && opts.runtime === 'node-webkit');
|
||||
if (nw) {
|
||||
options.timeout = 5000;
|
||||
if (process.platform === 'darwin') {
|
||||
shell_cmd = 'node-webkit';
|
||||
} else if (process.platform === 'win32') {
|
||||
shell_cmd = 'nw.exe';
|
||||
} else {
|
||||
shell_cmd = 'nw';
|
||||
}
|
||||
var modulePath = path.resolve(binary_module);
|
||||
var appDir = path.join(__dirname, 'util', 'nw-pre-gyp');
|
||||
args.push(appDir);
|
||||
args.push(modulePath);
|
||||
log.info("validate","Running test command: '" + shell_cmd + ' ' + args.join(' ') + "'");
|
||||
cp.execFile(shell_cmd, args, options, function(err, stdout, stderr) {
|
||||
// check for normal timeout for node-webkit
|
||||
if (err) {
|
||||
if (err.killed === true && err.signal && err.signal.indexOf('SIG') > -1) {
|
||||
return callback();
|
||||
}
|
||||
var stderrLog = stderr.toString();
|
||||
log.info('stderr', stderrLog);
|
||||
if( /^\s*Xlib:\s*extension\s*"RANDR"\s*missing\s*on\s*display\s*":\d+\.\d+"\.\s*$/.test(stderrLog) ){
|
||||
log.info('RANDR', 'stderr contains only RANDR error, ignored');
|
||||
return callback();
|
||||
}
|
||||
return callback(err);
|
||||
}
|
||||
return callback();
|
||||
});
|
||||
return;
|
||||
}
|
||||
if ((process.arch != opts.target_arch) ||
|
||||
(process.platform != opts.target_platform)) {
|
||||
var msg = "skipping validation since host platform/arch (";
|
||||
msg += process.platform+'/'+process.arch+")";
|
||||
msg += " does not match target (";
|
||||
msg += opts.target_platform+'/'+opts.target_arch+")";
|
||||
log.info('validate', msg);
|
||||
return callback();
|
||||
}
|
||||
args.push('--eval');
|
||||
args.push("'require(\\'" + binary_module.replace(/\'/g, '\\\'') +"\\')'");
|
||||
log.info("validate","Running test command: '" + shell_cmd + ' ' + args.join(' ') + "'");
|
||||
cp.execFile(shell_cmd, args, options, function(err, stdout, stderr) {
|
||||
if (err) {
|
||||
return callback(err, { stdout:stdout, stderr:stderr});
|
||||
}
|
||||
return callback();
|
||||
});
|
||||
}
|
||||
49
node_modules/sqlite3/node_modules/node-pre-gyp/lib/testpackage.js
generated
vendored
Normal file
49
node_modules/sqlite3/node_modules/node-pre-gyp/lib/testpackage.js
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = exports = testpackage;
|
||||
|
||||
exports.usage = 'Tests that the staged package is valid';
|
||||
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
var log = require('npmlog');
|
||||
var existsAsync = fs.exists || path.exists;
|
||||
var versioning = require('./util/versioning.js');
|
||||
var testbinary = require('./testbinary.js');
|
||||
var read = require('fs').createReadStream;
|
||||
var zlib = require('zlib');
|
||||
|
||||
function testpackage(gyp, argv, callback) {
|
||||
var package_json = JSON.parse(fs.readFileSync('./package.json'));
|
||||
var opts = versioning.evaluate(package_json, gyp.opts);
|
||||
var tarball = opts.staged_tarball;
|
||||
existsAsync(tarball, function(found) {
|
||||
if (!found) {
|
||||
return callback(new Error("Cannot test package because " + tarball + " missing: run `node-pre-gyp package` first"));
|
||||
}
|
||||
var to = opts.module_path;
|
||||
var gunzip = zlib.createGunzip();
|
||||
var extracter = require('tar').Extract({ path: to, strip: 1 });
|
||||
function filter_func(entry) {
|
||||
// ensure directories are +x
|
||||
// https://github.com/mapnik/node-mapnik/issues/262
|
||||
entry.props.mode |= (entry.props.mode >>> 2) & parseInt('0111',8);
|
||||
log.info('install','unpacking ' + entry.path);
|
||||
}
|
||||
gunzip.on('error', callback);
|
||||
extracter.on('error', callback);
|
||||
extracter.on('entry', filter_func);
|
||||
extracter.on('end', function(err) {
|
||||
if (err) return callback(err);
|
||||
testbinary(gyp,argv,function(err) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
} else {
|
||||
console.log('['+package_json.name+'] Package appears valid');
|
||||
return callback();
|
||||
}
|
||||
});
|
||||
});
|
||||
read(tarball).pipe(gunzip).pipe(extracter);
|
||||
});
|
||||
}
|
||||
41
node_modules/sqlite3/node_modules/node-pre-gyp/lib/unpublish.js
generated
vendored
Normal file
41
node_modules/sqlite3/node_modules/node-pre-gyp/lib/unpublish.js
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = exports = unpublish;
|
||||
|
||||
exports.usage = 'Unpublishes pre-built binary (requires aws-sdk)';
|
||||
|
||||
var fs = require('fs');
|
||||
var log = require('npmlog');
|
||||
var versioning = require('./util/versioning.js');
|
||||
var s3_setup = require('./util/s3_setup.js');
|
||||
var url = require('url');
|
||||
var config = require('rc')("node_pre_gyp",{acl:"public-read"});
|
||||
|
||||
function unpublish(gyp, argv, callback) {
|
||||
var AWS = require("aws-sdk");
|
||||
var package_json = JSON.parse(fs.readFileSync('./package.json'));
|
||||
var opts = versioning.evaluate(package_json, gyp.opts);
|
||||
s3_setup.detect(opts.hosted_path,config);
|
||||
AWS.config.update(config);
|
||||
var key_name = url.resolve(config.prefix,opts.package_name);
|
||||
var s3 = new AWS.S3();
|
||||
var s3_opts = { Bucket: config.bucket,
|
||||
Key: key_name
|
||||
};
|
||||
s3.headObject(s3_opts, function(err, meta) {
|
||||
if (err && err.code == 'NotFound') {
|
||||
console.log('['+package_json.name+'] Not found: https://' + s3_opts.Bucket + '.s3.amazonaws.com/' + s3_opts.Key);
|
||||
return callback();
|
||||
} else if(err) {
|
||||
return callback(err);
|
||||
} else {
|
||||
log.info('unpublish', JSON.stringify(meta));
|
||||
s3.deleteObject(s3_opts, function(err, resp) {
|
||||
if (err) return callback(err);
|
||||
log.info(JSON.stringify(resp));
|
||||
console.log('['+package_json.name+'] Success: removed https://' + s3_opts.Bucket + '.s3.amazonaws.com/' + s3_opts.Key);
|
||||
return callback();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
546
node_modules/sqlite3/node_modules/node-pre-gyp/lib/util/abi_crosswalk.json
generated
vendored
Normal file
546
node_modules/sqlite3/node_modules/node-pre-gyp/lib/util/abi_crosswalk.json
generated
vendored
Normal file
@@ -0,0 +1,546 @@
|
||||
{
|
||||
"0.8.0": {
|
||||
"node_abi": 1,
|
||||
"v8": "3.11"
|
||||
},
|
||||
"0.8.1": {
|
||||
"node_abi": 1,
|
||||
"v8": "3.11"
|
||||
},
|
||||
"0.8.2": {
|
||||
"node_abi": 1,
|
||||
"v8": "3.11"
|
||||
},
|
||||
"0.8.3": {
|
||||
"node_abi": 1,
|
||||
"v8": "3.11"
|
||||
},
|
||||
"0.8.4": {
|
||||
"node_abi": 1,
|
||||
"v8": "3.11"
|
||||
},
|
||||
"0.8.5": {
|
||||
"node_abi": 1,
|
||||
"v8": "3.11"
|
||||
},
|
||||
"0.8.6": {
|
||||
"node_abi": 1,
|
||||
"v8": "3.11"
|
||||
},
|
||||
"0.8.7": {
|
||||
"node_abi": 1,
|
||||
"v8": "3.11"
|
||||
},
|
||||
"0.8.8": {
|
||||
"node_abi": 1,
|
||||
"v8": "3.11"
|
||||
},
|
||||
"0.8.9": {
|
||||
"node_abi": 1,
|
||||
"v8": "3.11"
|
||||
},
|
||||
"0.8.10": {
|
||||
"node_abi": 1,
|
||||
"v8": "3.11"
|
||||
},
|
||||
"0.8.11": {
|
||||
"node_abi": 1,
|
||||
"v8": "3.11"
|
||||
},
|
||||
"0.8.12": {
|
||||
"node_abi": 1,
|
||||
"v8": "3.11"
|
||||
},
|
||||
"0.8.13": {
|
||||
"node_abi": 1,
|
||||
"v8": "3.11"
|
||||
},
|
||||
"0.8.14": {
|
||||
"node_abi": 1,
|
||||
"v8": "3.11"
|
||||
},
|
||||
"0.8.15": {
|
||||
"node_abi": 1,
|
||||
"v8": "3.11"
|
||||
},
|
||||
"0.8.16": {
|
||||
"node_abi": 1,
|
||||
"v8": "3.11"
|
||||
},
|
||||
"0.8.17": {
|
||||
"node_abi": 1,
|
||||
"v8": "3.11"
|
||||
},
|
||||
"0.8.18": {
|
||||
"node_abi": 1,
|
||||
"v8": "3.11"
|
||||
},
|
||||
"0.8.19": {
|
||||
"node_abi": 1,
|
||||
"v8": "3.11"
|
||||
},
|
||||
"0.8.20": {
|
||||
"node_abi": 1,
|
||||
"v8": "3.11"
|
||||
},
|
||||
"0.8.21": {
|
||||
"node_abi": 1,
|
||||
"v8": "3.11"
|
||||
},
|
||||
"0.8.22": {
|
||||
"node_abi": 1,
|
||||
"v8": "3.11"
|
||||
},
|
||||
"0.8.23": {
|
||||
"node_abi": 1,
|
||||
"v8": "3.11"
|
||||
},
|
||||
"0.8.24": {
|
||||
"node_abi": 1,
|
||||
"v8": "3.11"
|
||||
},
|
||||
"0.8.25": {
|
||||
"node_abi": 1,
|
||||
"v8": "3.11"
|
||||
},
|
||||
"0.8.26": {
|
||||
"node_abi": 1,
|
||||
"v8": "3.11"
|
||||
},
|
||||
"0.8.27": {
|
||||
"node_abi": 1,
|
||||
"v8": "3.11"
|
||||
},
|
||||
"0.8.28": {
|
||||
"node_abi": 1,
|
||||
"v8": "3.11"
|
||||
},
|
||||
"0.10.0": {
|
||||
"node_abi": 11,
|
||||
"v8": "3.14"
|
||||
},
|
||||
"0.10.1": {
|
||||
"node_abi": 11,
|
||||
"v8": "3.14"
|
||||
},
|
||||
"0.10.2": {
|
||||
"node_abi": 11,
|
||||
"v8": "3.14"
|
||||
},
|
||||
"0.10.3": {
|
||||
"node_abi": 11,
|
||||
"v8": "3.14"
|
||||
},
|
||||
"0.10.4": {
|
||||
"node_abi": 11,
|
||||
"v8": "3.14"
|
||||
},
|
||||
"0.10.5": {
|
||||
"node_abi": 11,
|
||||
"v8": "3.14"
|
||||
},
|
||||
"0.10.6": {
|
||||
"node_abi": 11,
|
||||
"v8": "3.14"
|
||||
},
|
||||
"0.10.7": {
|
||||
"node_abi": 11,
|
||||
"v8": "3.14"
|
||||
},
|
||||
"0.10.8": {
|
||||
"node_abi": 11,
|
||||
"v8": "3.14"
|
||||
},
|
||||
"0.10.9": {
|
||||
"node_abi": 11,
|
||||
"v8": "3.14"
|
||||
},
|
||||
"0.10.10": {
|
||||
"node_abi": 11,
|
||||
"v8": "3.14"
|
||||
},
|
||||
"0.10.11": {
|
||||
"node_abi": 11,
|
||||
"v8": "3.14"
|
||||
},
|
||||
"0.10.12": {
|
||||
"node_abi": 11,
|
||||
"v8": "3.14"
|
||||
},
|
||||
"0.10.13": {
|
||||
"node_abi": 11,
|
||||
"v8": "3.14"
|
||||
},
|
||||
"0.10.14": {
|
||||
"node_abi": 11,
|
||||
"v8": "3.14"
|
||||
},
|
||||
"0.10.15": {
|
||||
"node_abi": 11,
|
||||
"v8": "3.14"
|
||||
},
|
||||
"0.10.16": {
|
||||
"node_abi": 11,
|
||||
"v8": "3.14"
|
||||
},
|
||||
"0.10.17": {
|
||||
"node_abi": 11,
|
||||
"v8": "3.14"
|
||||
},
|
||||
"0.10.18": {
|
||||
"node_abi": 11,
|
||||
"v8": "3.14"
|
||||
},
|
||||
"0.10.19": {
|
||||
"node_abi": 11,
|
||||
"v8": "3.14"
|
||||
},
|
||||
"0.10.20": {
|
||||
"node_abi": 11,
|
||||
"v8": "3.14"
|
||||
},
|
||||
"0.10.21": {
|
||||
"node_abi": 11,
|
||||
"v8": "3.14"
|
||||
},
|
||||
"0.10.22": {
|
||||
"node_abi": 11,
|
||||
"v8": "3.14"
|
||||
},
|
||||
"0.10.23": {
|
||||
"node_abi": 11,
|
||||
"v8": "3.14"
|
||||
},
|
||||
"0.10.24": {
|
||||
"node_abi": 11,
|
||||
"v8": "3.14"
|
||||
},
|
||||
"0.10.25": {
|
||||
"node_abi": 11,
|
||||
"v8": "3.14"
|
||||
},
|
||||
"0.10.26": {
|
||||
"node_abi": 11,
|
||||
"v8": "3.14"
|
||||
},
|
||||
"0.10.27": {
|
||||
"node_abi": 11,
|
||||
"v8": "3.14"
|
||||
},
|
||||
"0.10.28": {
|
||||
"node_abi": 11,
|
||||
"v8": "3.14"
|
||||
},
|
||||
"0.10.29": {
|
||||
"node_abi": 11,
|
||||
"v8": "3.14"
|
||||
},
|
||||
"0.10.30": {
|
||||
"node_abi": 11,
|
||||
"v8": "3.14"
|
||||
},
|
||||
"0.10.31": {
|
||||
"node_abi": 11,
|
||||
"v8": "3.14"
|
||||
},
|
||||
"0.10.32": {
|
||||
"node_abi": 11,
|
||||
"v8": "3.14"
|
||||
},
|
||||
"0.10.33": {
|
||||
"node_abi": 11,
|
||||
"v8": "3.14"
|
||||
},
|
||||
"0.10.34": {
|
||||
"node_abi": 11,
|
||||
"v8": "3.14"
|
||||
},
|
||||
"0.10.35": {
|
||||
"node_abi": 11,
|
||||
"v8": "3.14"
|
||||
},
|
||||
"0.10.36": {
|
||||
"node_abi": 11,
|
||||
"v8": "3.14"
|
||||
},
|
||||
"0.10.37": {
|
||||
"node_abi": 11,
|
||||
"v8": "3.14"
|
||||
},
|
||||
"0.10.38": {
|
||||
"node_abi": 11,
|
||||
"v8": "3.14"
|
||||
},
|
||||
"0.10.39": {
|
||||
"node_abi": 11,
|
||||
"v8": "3.14"
|
||||
},
|
||||
"0.10.40": {
|
||||
"node_abi": 11,
|
||||
"v8": "3.14"
|
||||
},
|
||||
"0.11.0": {
|
||||
"node_abi": 12,
|
||||
"v8": "3.17"
|
||||
},
|
||||
"0.11.1": {
|
||||
"node_abi": 12,
|
||||
"v8": "3.18"
|
||||
},
|
||||
"0.11.2": {
|
||||
"node_abi": 12,
|
||||
"v8": "3.19"
|
||||
},
|
||||
"0.11.3": {
|
||||
"node_abi": 12,
|
||||
"v8": "3.19"
|
||||
},
|
||||
"0.11.4": {
|
||||
"node_abi": 12,
|
||||
"v8": "3.20"
|
||||
},
|
||||
"0.11.5": {
|
||||
"node_abi": 12,
|
||||
"v8": "3.20"
|
||||
},
|
||||
"0.11.6": {
|
||||
"node_abi": 12,
|
||||
"v8": "3.20"
|
||||
},
|
||||
"0.11.7": {
|
||||
"node_abi": 12,
|
||||
"v8": "3.20"
|
||||
},
|
||||
"0.11.8": {
|
||||
"node_abi": 13,
|
||||
"v8": "3.21"
|
||||
},
|
||||
"0.11.9": {
|
||||
"node_abi": 13,
|
||||
"v8": "3.22"
|
||||
},
|
||||
"0.11.10": {
|
||||
"node_abi": 13,
|
||||
"v8": "3.22"
|
||||
},
|
||||
"0.11.11": {
|
||||
"node_abi": 14,
|
||||
"v8": "3.22"
|
||||
},
|
||||
"0.11.12": {
|
||||
"node_abi": 14,
|
||||
"v8": "3.22"
|
||||
},
|
||||
"0.11.13": {
|
||||
"node_abi": 14,
|
||||
"v8": "3.25"
|
||||
},
|
||||
"0.11.14": {
|
||||
"node_abi": 14,
|
||||
"v8": "3.26"
|
||||
},
|
||||
"0.11.15": {
|
||||
"node_abi": 14,
|
||||
"v8": "3.28"
|
||||
},
|
||||
"0.11.16": {
|
||||
"node_abi": 14,
|
||||
"v8": "3.28"
|
||||
},
|
||||
"0.12.0": {
|
||||
"node_abi": 14,
|
||||
"v8": "3.28"
|
||||
},
|
||||
"0.12.1": {
|
||||
"node_abi": 14,
|
||||
"v8": "3.28"
|
||||
},
|
||||
"0.12.2": {
|
||||
"node_abi": 14,
|
||||
"v8": "3.28"
|
||||
},
|
||||
"0.12.3": {
|
||||
"node_abi": 14,
|
||||
"v8": "3.28"
|
||||
},
|
||||
"0.12.4": {
|
||||
"node_abi": 14,
|
||||
"v8": "3.28"
|
||||
},
|
||||
"0.12.5": {
|
||||
"node_abi": 14,
|
||||
"v8": "3.28"
|
||||
},
|
||||
"0.12.6": {
|
||||
"node_abi": 14,
|
||||
"v8": "3.28"
|
||||
},
|
||||
"0.12.7": {
|
||||
"node_abi": 14,
|
||||
"v8": "3.28"
|
||||
},
|
||||
"1.0.0": {
|
||||
"node_abi": 42,
|
||||
"v8": "3.31"
|
||||
},
|
||||
"1.0.1": {
|
||||
"node_abi": 42,
|
||||
"v8": "3.31"
|
||||
},
|
||||
"1.0.2": {
|
||||
"node_abi": 42,
|
||||
"v8": "3.31"
|
||||
},
|
||||
"1.0.3": {
|
||||
"node_abi": 42,
|
||||
"v8": "4.1"
|
||||
},
|
||||
"1.0.4": {
|
||||
"node_abi": 42,
|
||||
"v8": "4.1"
|
||||
},
|
||||
"1.1.0": {
|
||||
"node_abi": 43,
|
||||
"v8": "4.1"
|
||||
},
|
||||
"1.2.0": {
|
||||
"node_abi": 43,
|
||||
"v8": "4.1"
|
||||
},
|
||||
"1.3.0": {
|
||||
"node_abi": 43,
|
||||
"v8": "4.1"
|
||||
},
|
||||
"1.4.1": {
|
||||
"node_abi": 43,
|
||||
"v8": "4.1"
|
||||
},
|
||||
"1.4.2": {
|
||||
"node_abi": 43,
|
||||
"v8": "4.1"
|
||||
},
|
||||
"1.4.3": {
|
||||
"node_abi": 43,
|
||||
"v8": "4.1"
|
||||
},
|
||||
"1.5.0": {
|
||||
"node_abi": 43,
|
||||
"v8": "4.1"
|
||||
},
|
||||
"1.5.1": {
|
||||
"node_abi": 43,
|
||||
"v8": "4.1"
|
||||
},
|
||||
"1.6.0": {
|
||||
"node_abi": 43,
|
||||
"v8": "4.1"
|
||||
},
|
||||
"1.6.1": {
|
||||
"node_abi": 43,
|
||||
"v8": "4.1"
|
||||
},
|
||||
"1.6.2": {
|
||||
"node_abi": 43,
|
||||
"v8": "4.1"
|
||||
},
|
||||
"1.6.3": {
|
||||
"node_abi": 43,
|
||||
"v8": "4.1"
|
||||
},
|
||||
"1.6.4": {
|
||||
"node_abi": 43,
|
||||
"v8": "4.1"
|
||||
},
|
||||
"1.7.1": {
|
||||
"node_abi": 43,
|
||||
"v8": "4.1"
|
||||
},
|
||||
"1.8.1": {
|
||||
"node_abi": 43,
|
||||
"v8": "4.1"
|
||||
},
|
||||
"1.8.2": {
|
||||
"node_abi": 43,
|
||||
"v8": "4.1"
|
||||
},
|
||||
"1.8.3": {
|
||||
"node_abi": 43,
|
||||
"v8": "4.1"
|
||||
},
|
||||
"1.8.4": {
|
||||
"node_abi": 43,
|
||||
"v8": "4.1"
|
||||
},
|
||||
"2.0.0": {
|
||||
"node_abi": 44,
|
||||
"v8": "4.2"
|
||||
},
|
||||
"2.0.1": {
|
||||
"node_abi": 44,
|
||||
"v8": "4.2"
|
||||
},
|
||||
"2.0.2": {
|
||||
"node_abi": 44,
|
||||
"v8": "4.2"
|
||||
},
|
||||
"2.1.0": {
|
||||
"node_abi": 44,
|
||||
"v8": "4.2"
|
||||
},
|
||||
"2.2.0": {
|
||||
"node_abi": 44,
|
||||
"v8": "4.2"
|
||||
},
|
||||
"2.2.1": {
|
||||
"node_abi": 44,
|
||||
"v8": "4.2"
|
||||
},
|
||||
"2.3.0": {
|
||||
"node_abi": 44,
|
||||
"v8": "4.2"
|
||||
},
|
||||
"2.3.1": {
|
||||
"node_abi": 44,
|
||||
"v8": "4.2"
|
||||
},
|
||||
"2.3.2": {
|
||||
"node_abi": 44,
|
||||
"v8": "4.2"
|
||||
},
|
||||
"2.3.3": {
|
||||
"node_abi": 44,
|
||||
"v8": "4.2"
|
||||
},
|
||||
"2.3.4": {
|
||||
"node_abi": 44,
|
||||
"v8": "4.2"
|
||||
},
|
||||
"2.4.0": {
|
||||
"node_abi": 44,
|
||||
"v8": "4.2"
|
||||
},
|
||||
"2.5.0": {
|
||||
"node_abi": 44,
|
||||
"v8": "4.2"
|
||||
},
|
||||
"3.0.0": {
|
||||
"node_abi": 45,
|
||||
"v8": "4.4"
|
||||
},
|
||||
"3.1.0": {
|
||||
"node_abi": 45,
|
||||
"v8": "4.4"
|
||||
},
|
||||
"3.2.0": {
|
||||
"node_abi": 45,
|
||||
"v8": "4.4"
|
||||
},
|
||||
"3.3.0": {
|
||||
"node_abi": 45,
|
||||
"v8": "4.4"
|
||||
},
|
||||
"4.0.0": {
|
||||
"node_abi": 46,
|
||||
"v8": "4.5"
|
||||
}
|
||||
}
|
||||
87
node_modules/sqlite3/node_modules/node-pre-gyp/lib/util/compile.js
generated
vendored
Normal file
87
node_modules/sqlite3/node_modules/node-pre-gyp/lib/util/compile.js
generated
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = exports;
|
||||
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
var win = process.platform == 'win32';
|
||||
var existsSync = fs.existsSync || path.existsSync;
|
||||
var cp = require('child_process');
|
||||
|
||||
// try to build up the complete path to node-gyp
|
||||
/* priority:
|
||||
- node-gyp on ENV:npm_config_node_gyp (https://github.com/npm/npm/pull/4887)
|
||||
- node-gyp on NODE_PATH
|
||||
- node-gyp inside npm on NODE_PATH (ignore on iojs)
|
||||
- node-gyp inside npm beside node exe
|
||||
*/
|
||||
function which_node_gyp() {
|
||||
var node_gyp_bin;
|
||||
if (process.env.npm_config_node_gyp) {
|
||||
try {
|
||||
node_gyp_bin = process.env.npm_config_node_gyp;
|
||||
if (existsSync(node_gyp_bin)) {
|
||||
return node_gyp_bin;
|
||||
}
|
||||
} catch (err) { }
|
||||
}
|
||||
try {
|
||||
var node_gyp_main = require.resolve('node-gyp');
|
||||
node_gyp_bin = path.join(path.dirname(
|
||||
path.dirname(node_gyp_main)),
|
||||
'bin/node-gyp.js');
|
||||
if (existsSync(node_gyp_bin)) {
|
||||
return node_gyp_bin;
|
||||
}
|
||||
} catch (err) { }
|
||||
if (process.execPath.indexOf('iojs') === -1) {
|
||||
try {
|
||||
var npm_main = require.resolve('npm');
|
||||
node_gyp_bin = path.join(path.dirname(
|
||||
path.dirname(npm_main)),
|
||||
'node_modules/node-gyp/bin/node-gyp.js');
|
||||
if (existsSync(node_gyp_bin)) {
|
||||
return node_gyp_bin;
|
||||
}
|
||||
} catch (err) { }
|
||||
}
|
||||
var npm_base = path.join(path.dirname(
|
||||
path.dirname(process.execPath)),
|
||||
'lib/node_modules/npm/');
|
||||
node_gyp_bin = path.join(npm_base, 'node_modules/node-gyp/bin/node-gyp.js');
|
||||
if (existsSync(node_gyp_bin)) {
|
||||
return node_gyp_bin;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports.run_gyp = function(args,opts,callback) {
|
||||
var shell_cmd = '';
|
||||
var cmd_args = [];
|
||||
if (opts.runtime && opts.runtime == 'node-webkit') {
|
||||
shell_cmd = 'nw-gyp';
|
||||
if (win) shell_cmd += '.cmd';
|
||||
} else {
|
||||
var node_gyp_path = which_node_gyp();
|
||||
if (node_gyp_path) {
|
||||
shell_cmd = process.execPath;
|
||||
cmd_args.push(node_gyp_path);
|
||||
} else {
|
||||
shell_cmd = 'node-gyp';
|
||||
if (win) shell_cmd += '.cmd';
|
||||
}
|
||||
}
|
||||
var final_args = cmd_args.concat(args);
|
||||
var cmd = cp.spawn(shell_cmd, final_args, {cwd: undefined, env: process.env, stdio: [ 0, 1, 2]});
|
||||
cmd.on('error', function (err) {
|
||||
if (err) {
|
||||
return callback(new Error("Failed to execute '" + shell_cmd + ' ' + final_args.join(' ') + "' (" + err + ")"));
|
||||
}
|
||||
callback(null,opts);
|
||||
});
|
||||
cmd.on('close', function (code) {
|
||||
if (code && code !== 0) {
|
||||
return callback(new Error("Failed to execute '" + shell_cmd + ' ' + final_args.join(' ') + "' (" + code + ")"));
|
||||
}
|
||||
callback(null,opts);
|
||||
});
|
||||
};
|
||||
94
node_modules/sqlite3/node_modules/node-pre-gyp/lib/util/handle_gyp_opts.js
generated
vendored
Normal file
94
node_modules/sqlite3/node_modules/node-pre-gyp/lib/util/handle_gyp_opts.js
generated
vendored
Normal file
@@ -0,0 +1,94 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = exports = handle_gyp_opts;
|
||||
|
||||
var fs = require('fs');
|
||||
var versioning = require('./versioning.js');
|
||||
|
||||
/*
|
||||
|
||||
Here we gather node-pre-gyp generated options (from versioning) and pass them along to node-gyp.
|
||||
|
||||
We massage the args and options slightly to account for differences in what commands mean between
|
||||
node-pre-gyp and node-gyp (e.g. see the difference between "build" and "rebuild" below)
|
||||
|
||||
Keep in mind: the values inside `argv` and `gyp.opts` below are different depending on whether
|
||||
node-pre-gyp is called directory, or if it is called in a `run-script` phase of npm.
|
||||
|
||||
We also try to preserve any command line options that might have been passed to npm or node-pre-gyp.
|
||||
But this is fairly difficult without passing way to much through. For example `gyp.opts` contains all
|
||||
the process.env and npm pushes a lot of variables into process.env which node-pre-gyp inherits. So we have
|
||||
to be very selective about what we pass through.
|
||||
|
||||
For example:
|
||||
|
||||
`npm install --build-from-source` will give:
|
||||
|
||||
argv == [ 'rebuild' ]
|
||||
gyp.opts.argv == { remain: [ 'install' ],
|
||||
cooked: [ 'install', '--fallback-to-build' ],
|
||||
original: [ 'install', '--fallback-to-build' ] }
|
||||
|
||||
`./bin/node-pre-gyp build` will give:
|
||||
|
||||
argv == []
|
||||
gyp.opts.argv == { remain: [ 'build' ],
|
||||
cooked: [ 'build' ],
|
||||
original: [ '-C', 'test/app1', 'build' ] }
|
||||
|
||||
*/
|
||||
|
||||
// select set of node-pre-gyp versioning info
|
||||
// to share with node-gyp
|
||||
var share_with_node_gyp = [
|
||||
'module',
|
||||
'module_name',
|
||||
'module_path',
|
||||
];
|
||||
|
||||
function handle_gyp_opts(gyp, argv, callback) {
|
||||
|
||||
// Collect node-pre-gyp specific variables to pass to node-gyp
|
||||
var node_pre_gyp_options = [];
|
||||
// generate custom node-pre-gyp versioning info
|
||||
var opts = versioning.evaluate(JSON.parse(fs.readFileSync('./package.json')), gyp.opts);
|
||||
share_with_node_gyp.forEach(function(key) {
|
||||
var val = opts[key];
|
||||
if (val) {
|
||||
node_pre_gyp_options.push('--' + key + '=' + val);
|
||||
} else {
|
||||
return callback(new Error("Option " + key + " required but not found by node-pre-gyp"));
|
||||
}
|
||||
});
|
||||
|
||||
// Collect options that follow the special -- which disables nopt parsing
|
||||
var unparsed_options = [];
|
||||
var double_hyphen_found = false;
|
||||
gyp.opts.argv.original.forEach(function(opt) {
|
||||
if (double_hyphen_found) {
|
||||
unparsed_options.push(opt);
|
||||
}
|
||||
if (opt == '--') {
|
||||
double_hyphen_found = true;
|
||||
}
|
||||
});
|
||||
|
||||
// We try respect and pass through remaining command
|
||||
// line options (like --foo=bar) to node-gyp
|
||||
var cooked = gyp.opts.argv.cooked;
|
||||
var node_gyp_options = [];
|
||||
cooked.forEach(function(value) {
|
||||
if (value.length > 2 && value.slice(0,2) == '--') {
|
||||
var key = value.slice(2);
|
||||
var val = cooked[cooked.indexOf(value)+1];
|
||||
if (val && val.indexOf('--') === -1) { // handle '--foo=bar' or ['--foo','bar']
|
||||
node_gyp_options.push('--' + key + '=' + val);
|
||||
} else { // pass through --foo
|
||||
node_gyp_options.push(value);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var result = {'opts':opts,'gyp':node_gyp_options,'pre':node_pre_gyp_options,'unparsed':unparsed_options};
|
||||
return callback(null,result);
|
||||
}
|
||||
26
node_modules/sqlite3/node_modules/node-pre-gyp/lib/util/nw-pre-gyp/index.html
generated
vendored
Normal file
26
node_modules/sqlite3/node_modules/node-pre-gyp/lib/util/nw-pre-gyp/index.html
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Node-webkit-based module test</title>
|
||||
<script>
|
||||
function nwModuleTest(){
|
||||
var util = require('util');
|
||||
var moduleFolder = require('nw.gui').App.argv[0];
|
||||
try {
|
||||
require(moduleFolder);
|
||||
} catch(e) {
|
||||
if( process.platform !== 'win32' ){
|
||||
util.log('nw-pre-gyp error:');
|
||||
util.log(e.stack);
|
||||
}
|
||||
process.exit(1);
|
||||
}
|
||||
process.exit(0);
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="nwModuleTest()">
|
||||
<h1>Node-webkit-based module test</h1>
|
||||
</body>
|
||||
</html>
|
||||
9
node_modules/sqlite3/node_modules/node-pre-gyp/lib/util/nw-pre-gyp/package.json
generated
vendored
Normal file
9
node_modules/sqlite3/node_modules/node-pre-gyp/lib/util/nw-pre-gyp/package.json
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"main": "index.html",
|
||||
"name": "nw-pre-gyp-module-test",
|
||||
"description": "Node-webkit-based module test.",
|
||||
"version": "0.0.1",
|
||||
"window": {
|
||||
"show": false
|
||||
}
|
||||
}
|
||||
27
node_modules/sqlite3/node_modules/node-pre-gyp/lib/util/s3_setup.js
generated
vendored
Normal file
27
node_modules/sqlite3/node_modules/node-pre-gyp/lib/util/s3_setup.js
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = exports;
|
||||
|
||||
var url = require('url');
|
||||
|
||||
var URI_REGEX="^(.*)\.(s3(?:-.*)?)\.amazonaws\.com$";
|
||||
|
||||
module.exports.detect = function(to,config) {
|
||||
var uri = url.parse(to);
|
||||
var hostname_matches = uri.hostname.match(URI_REGEX);
|
||||
config.prefix = (!uri.pathname || uri.pathname == '/') ? '' : uri.pathname.replace('/','');
|
||||
if(!hostname_matches) {
|
||||
return;
|
||||
}
|
||||
if (!config.bucket) {
|
||||
config.bucket = hostname_matches[1];
|
||||
}
|
||||
if (!config.region) {
|
||||
var s3_domain = hostname_matches[2];
|
||||
if (s3_domain.slice(0,3) == 's3-' &&
|
||||
s3_domain.length >= 3) {
|
||||
// it appears the region is explicit in the url
|
||||
config.region = s3_domain.replace('s3-','');
|
||||
}
|
||||
}
|
||||
};
|
||||
276
node_modules/sqlite3/node_modules/node-pre-gyp/lib/util/versioning.js
generated
vendored
Normal file
276
node_modules/sqlite3/node_modules/node-pre-gyp/lib/util/versioning.js
generated
vendored
Normal file
@@ -0,0 +1,276 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = exports;
|
||||
|
||||
var path = require('path');
|
||||
var semver = require('semver');
|
||||
var url = require('url');
|
||||
|
||||
var abi_crosswalk;
|
||||
|
||||
// This is used for unit testing to provide a fake
|
||||
// ABI crosswalk that emulates one that is not updated
|
||||
// for the current version
|
||||
if (process.env.NODE_PRE_GYP_ABI_CROSSWALK) {
|
||||
abi_crosswalk = require(process.env.NODE_PRE_GYP_ABI_CROSSWALK);
|
||||
} else {
|
||||
abi_crosswalk = require('./abi_crosswalk.json');
|
||||
}
|
||||
|
||||
function get_node_webkit_abi(runtime, target_version) {
|
||||
if (!runtime) {
|
||||
throw new Error("get_node_webkit_abi requires valid runtime arg");
|
||||
}
|
||||
if (typeof target_version === 'undefined') {
|
||||
// erroneous CLI call
|
||||
throw new Error("Empty target version is not supported if node-webkit is the target.");
|
||||
}
|
||||
return runtime + '-v' + target_version;
|
||||
}
|
||||
module.exports.get_node_webkit_abi = get_node_webkit_abi;
|
||||
|
||||
function get_node_abi(runtime, versions) {
|
||||
if (!runtime) {
|
||||
throw new Error("get_node_abi requires valid runtime arg");
|
||||
}
|
||||
if (!versions) {
|
||||
throw new Error("get_node_abi requires valid process.versions object");
|
||||
}
|
||||
var sem_ver = semver.parse(versions.node);
|
||||
if (sem_ver.major === 0 && sem_ver.minor % 2) { // odd series
|
||||
// https://github.com/mapbox/node-pre-gyp/issues/124
|
||||
return runtime+'-v'+versions.node;
|
||||
} else {
|
||||
// process.versions.modules added in >= v0.10.4 and v0.11.7
|
||||
// https://github.com/joyent/node/commit/ccabd4a6fa8a6eb79d29bc3bbe9fe2b6531c2d8e
|
||||
return versions.modules ? runtime+'-v' + (+versions.modules) :
|
||||
'v8-' + versions.v8.split('.').slice(0,2).join('.');
|
||||
}
|
||||
}
|
||||
module.exports.get_node_abi = get_node_abi;
|
||||
|
||||
function get_runtime_abi(runtime, target_version) {
|
||||
if (!runtime) {
|
||||
throw new Error("get_runtime_abi requires valid runtime arg");
|
||||
}
|
||||
if (runtime === 'node-webkit') {
|
||||
return get_node_webkit_abi(runtime, target_version || process.versions['node-webkit']);
|
||||
} else {
|
||||
if (runtime != 'node') {
|
||||
throw new Error("Unknown Runtime: '" + runtime + "'");
|
||||
}
|
||||
if (!target_version) {
|
||||
return get_node_abi(runtime,process.versions);
|
||||
} else {
|
||||
var cross_obj;
|
||||
// abi_crosswalk generated with ./scripts/abi_crosswalk.js
|
||||
if (abi_crosswalk[target_version]) {
|
||||
cross_obj = abi_crosswalk[target_version];
|
||||
} else {
|
||||
var target_parts = target_version.split('.').map(function(i) { return +i; });
|
||||
if (target_parts.length != 3) { // parse failed
|
||||
throw new Error("Unknown target version: " + target_version);
|
||||
}
|
||||
/*
|
||||
The below code tries to infer the last known ABI compatible version
|
||||
that we have recorded in the abi_crosswalk.json when an exact match
|
||||
is not possible. The reasons for this to exist are complicated:
|
||||
|
||||
- We support passing --target to be able to allow developers to package binaries for versions of node
|
||||
that are not the same one as they are running. This might also be used in combination with the
|
||||
--target_arch or --target_platform flags to also package binaries for alternative platforms
|
||||
- When --target is passed we can't therefore determine the ABI (process.versions.modules) from the node
|
||||
version that is running in memory
|
||||
- So, therefore node-pre-gyp keeps an "ABI crosswalk" (lib/util/abi_crosswalk.json) to be able to look
|
||||
this info up for all versions
|
||||
- But we cannot easily predict what the future ABI will be for released versions
|
||||
- And node-pre-gyp needs to be a `bundledDependency` in apps that depend on it in order to work correctly
|
||||
by being fully available at install time.
|
||||
- So, the speed of node releases and the bundled nature of node-pre-gyp mean that a new node-pre-gyp release
|
||||
need to happen for every node.js/io.js/node-webkit/nw.js/atom-shell/etc release that might come online if
|
||||
you want the `--target` flag to keep working for the latest version
|
||||
- Which is impractical ^^
|
||||
- Hence the below code guesses about future ABI to make the need to update node-pre-gyp less demanding.
|
||||
|
||||
In practice then you can have a dependency of your app like `node-sqlite3` that bundles a `node-pre-gyp` that
|
||||
only knows about node v0.10.33 in the `abi_crosswalk.json` but target node v0.10.34 (which is assumed to be
|
||||
ABI compatible with v0.10.33).
|
||||
|
||||
TODO: use semver module instead of custom version parsing
|
||||
*/
|
||||
var major = target_parts[0];
|
||||
var minor = target_parts[1];
|
||||
var patch = target_parts[2];
|
||||
// io.js: yeah if node.js ever releases 1.x this will break
|
||||
// but that is unlikely to happen: https://github.com/iojs/io.js/pull/253#issuecomment-69432616
|
||||
if (major === 1) {
|
||||
// look for last release that is the same major version
|
||||
// e.g. we assume io.js 1.x is ABI compatible with >= 1.0.0
|
||||
while (true) {
|
||||
if (minor > 0) --minor;
|
||||
if (patch > 0) --patch;
|
||||
var new_iojs_target = '' + major + '.' + minor + '.' + patch;
|
||||
if (abi_crosswalk[new_iojs_target]) {
|
||||
cross_obj = abi_crosswalk[new_iojs_target];
|
||||
console.log('Warning: node-pre-gyp could not find exact match for ' + target_version);
|
||||
console.log('Warning: but node-pre-gyp successfully choose ' + new_iojs_target + ' as ABI compatible target');
|
||||
break;
|
||||
}
|
||||
if (minor === 0 && patch === 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (major === 0) { // node.js
|
||||
if (target_parts[1] % 2 === 0) { // for stable/even node.js series
|
||||
// look for the last release that is the same minor release
|
||||
// e.g. we assume node 0.10.x is ABI compatible with >= 0.10.0
|
||||
while (--patch > 0) {
|
||||
var new_node_target = '' + major + '.' + minor + '.' + patch;
|
||||
if (abi_crosswalk[new_node_target]) {
|
||||
cross_obj = abi_crosswalk[new_node_target];
|
||||
console.log('Warning: node-pre-gyp could not find exact match for ' + target_version);
|
||||
console.log('Warning: but node-pre-gyp successfully choose ' + new_node_target + ' as ABI compatible target');
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!cross_obj) {
|
||||
throw new Error("Unsupported target version: " + target_version);
|
||||
}
|
||||
// emulate process.versions
|
||||
var versions_obj = {
|
||||
node: target_version,
|
||||
v8: cross_obj.v8+'.0',
|
||||
// abi_crosswalk uses 1 for node versions lacking process.versions.modules
|
||||
// process.versions.modules added in >= v0.10.4 and v0.11.7
|
||||
modules: cross_obj.node_abi > 1 ? cross_obj.node_abi : undefined
|
||||
};
|
||||
return get_node_abi(runtime, versions_obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
module.exports.get_runtime_abi = get_runtime_abi;
|
||||
|
||||
var required_parameters = [
|
||||
'module_name',
|
||||
'module_path',
|
||||
'host'
|
||||
];
|
||||
|
||||
function validate_config(package_json) {
|
||||
var msg = package_json.name + ' package.json is not node-pre-gyp ready:\n';
|
||||
var missing = [];
|
||||
if (!package_json.main) {
|
||||
missing.push('main');
|
||||
}
|
||||
if (!package_json.version) {
|
||||
missing.push('version');
|
||||
}
|
||||
if (!package_json.name) {
|
||||
missing.push('name');
|
||||
}
|
||||
if (!package_json.binary) {
|
||||
missing.push('binary');
|
||||
}
|
||||
var o = package_json.binary;
|
||||
required_parameters.forEach(function(p) {
|
||||
if (missing.indexOf('binary') > -1) {
|
||||
missing.pop('binary');
|
||||
}
|
||||
if (!o || o[p] === undefined) {
|
||||
missing.push('binary.' + p);
|
||||
}
|
||||
});
|
||||
if (missing.length >= 1) {
|
||||
throw new Error(msg+"package.json must declare these properties: \n" + missing.join('\n'));
|
||||
}
|
||||
if (o) {
|
||||
// enforce https over http
|
||||
var protocol = url.parse(o.host).protocol;
|
||||
if (protocol === 'http:') {
|
||||
throw new Error("'host' protocol ("+protocol+") is invalid - only 'https:' is accepted");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports.validate_config = validate_config;
|
||||
|
||||
function eval_template(template,opts) {
|
||||
Object.keys(opts).forEach(function(key) {
|
||||
var pattern = '{'+key+'}';
|
||||
while (template.indexOf(pattern) > -1) {
|
||||
template = template.replace(pattern,opts[key]);
|
||||
}
|
||||
});
|
||||
return template;
|
||||
}
|
||||
|
||||
// url.resolve needs single trailing slash
|
||||
// to behave correctly, otherwise a double slash
|
||||
// may end up in the url which breaks requests
|
||||
// and a lacking slash may not lead to proper joining
|
||||
function fix_slashes(pathname) {
|
||||
if (pathname.slice(-1) != '/') {
|
||||
return pathname + '/';
|
||||
}
|
||||
return pathname;
|
||||
}
|
||||
|
||||
// remove double slashes
|
||||
// note: path.normalize will not work because
|
||||
// it will convert forward to back slashes
|
||||
function drop_double_slashes(pathname) {
|
||||
return pathname.replace(/\/\//g,'/');
|
||||
}
|
||||
|
||||
var default_package_name = '{module_name}-v{version}-{node_abi}-{platform}-{arch}.tar.gz';
|
||||
var default_remote_path = '';
|
||||
|
||||
module.exports.evaluate = function(package_json,options) {
|
||||
options = options || {};
|
||||
validate_config(package_json);
|
||||
var v = package_json.version;
|
||||
var module_version = semver.parse(v);
|
||||
var runtime = options.runtime || (process.versions['node-webkit'] ? 'node-webkit' : 'node');
|
||||
var opts = {
|
||||
name: package_json.name,
|
||||
configuration: Boolean(options.debug) ? 'Debug' : 'Release',
|
||||
debug: options.debug,
|
||||
module_name: package_json.binary.module_name,
|
||||
version: module_version.version,
|
||||
prerelease: module_version.prerelease.length ? module_version.prerelease.join('.') : '',
|
||||
build: module_version.build.length ? module_version.build.join('.') : '',
|
||||
major: module_version.major,
|
||||
minor: module_version.minor,
|
||||
patch: module_version.patch,
|
||||
runtime: runtime,
|
||||
node_abi: get_runtime_abi(runtime,options.target),
|
||||
target: options.target || '',
|
||||
platform: options.target_platform || process.platform,
|
||||
target_platform: options.target_platform || process.platform,
|
||||
arch: options.target_arch || process.arch,
|
||||
target_arch: options.target_arch || process.arch,
|
||||
module_main: package_json.main,
|
||||
toolset : options.toolset || '' // address https://github.com/mapbox/node-pre-gyp/issues/119
|
||||
};
|
||||
opts.host = fix_slashes(eval_template(package_json.binary.host,opts));
|
||||
opts.module_path = eval_template(package_json.binary.module_path,opts);
|
||||
// now we resolve the module_path to ensure it is absolute so that binding.gyp variables work predictably
|
||||
if (options.module_root) {
|
||||
// resolve relative to known module root: works for pre-binding require
|
||||
opts.module_path = path.join(options.module_root,opts.module_path);
|
||||
} else {
|
||||
// resolve relative to current working directory: works for node-pre-gyp commands
|
||||
opts.module_path = path.resolve(opts.module_path);
|
||||
}
|
||||
opts.module = path.join(opts.module_path,opts.module_name + '.node');
|
||||
opts.remote_path = package_json.binary.remote_path ? drop_double_slashes(fix_slashes(eval_template(package_json.binary.remote_path,opts))) : default_remote_path;
|
||||
var package_name = package_json.binary.package_name ? package_json.binary.package_name : default_package_name;
|
||||
opts.package_name = eval_template(package_name,opts);
|
||||
opts.staged_tarball = path.join('build/stage',opts.remote_path,opts.package_name);
|
||||
opts.hosted_path = url.resolve(opts.host,opts.remote_path);
|
||||
opts.hosted_tarball = url.resolve(opts.hosted_path,opts.package_name);
|
||||
return opts;
|
||||
};
|
||||
15
node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/.bin/mkdirp
generated
vendored
Normal file
15
node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/.bin/mkdirp
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
basedir=`dirname "$0"`
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
"$basedir/node" "$basedir/../mkdirp/bin/cmd.js" "$@"
|
||||
ret=$?
|
||||
else
|
||||
node "$basedir/../mkdirp/bin/cmd.js" "$@"
|
||||
ret=$?
|
||||
fi
|
||||
exit $ret
|
||||
7
node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/.bin/mkdirp.cmd
generated
vendored
Normal file
7
node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/.bin/mkdirp.cmd
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
@IF EXIST "%~dp0\node.exe" (
|
||||
"%~dp0\node.exe" "%~dp0\..\mkdirp\bin\cmd.js" %*
|
||||
) ELSE (
|
||||
@SETLOCAL
|
||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
node "%~dp0\..\mkdirp\bin\cmd.js" %*
|
||||
)
|
||||
15
node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/.bin/nopt
generated
vendored
Normal file
15
node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/.bin/nopt
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
basedir=`dirname "$0"`
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
"$basedir/node" "$basedir/../nopt/bin/nopt.js" "$@"
|
||||
ret=$?
|
||||
else
|
||||
node "$basedir/../nopt/bin/nopt.js" "$@"
|
||||
ret=$?
|
||||
fi
|
||||
exit $ret
|
||||
7
node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/.bin/nopt.cmd
generated
vendored
Normal file
7
node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/.bin/nopt.cmd
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
@IF EXIST "%~dp0\node.exe" (
|
||||
"%~dp0\node.exe" "%~dp0\..\nopt\bin\nopt.js" %*
|
||||
) ELSE (
|
||||
@SETLOCAL
|
||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
node "%~dp0\..\nopt\bin\nopt.js" %*
|
||||
)
|
||||
15
node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/.bin/rc
generated
vendored
Normal file
15
node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/.bin/rc
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
basedir=`dirname "$0"`
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
"$basedir/node" "$basedir/../rc/index.js" "$@"
|
||||
ret=$?
|
||||
else
|
||||
node "$basedir/../rc/index.js" "$@"
|
||||
ret=$?
|
||||
fi
|
||||
exit $ret
|
||||
7
node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/.bin/rc.cmd
generated
vendored
Normal file
7
node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/.bin/rc.cmd
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
@IF EXIST "%~dp0\node.exe" (
|
||||
"%~dp0\node.exe" "%~dp0\..\rc\index.js" %*
|
||||
) ELSE (
|
||||
@SETLOCAL
|
||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
node "%~dp0\..\rc\index.js" %*
|
||||
)
|
||||
15
node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/.bin/rimraf
generated
vendored
Normal file
15
node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/.bin/rimraf
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
basedir=`dirname "$0"`
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
"$basedir/node" "$basedir/../rimraf/bin.js" "$@"
|
||||
ret=$?
|
||||
else
|
||||
node "$basedir/../rimraf/bin.js" "$@"
|
||||
ret=$?
|
||||
fi
|
||||
exit $ret
|
||||
7
node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/.bin/rimraf.cmd
generated
vendored
Normal file
7
node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/.bin/rimraf.cmd
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
@IF EXIST "%~dp0\node.exe" (
|
||||
"%~dp0\node.exe" "%~dp0\..\rimraf\bin.js" %*
|
||||
) ELSE (
|
||||
@SETLOCAL
|
||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
node "%~dp0\..\rimraf\bin.js" %*
|
||||
)
|
||||
15
node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/.bin/semver
generated
vendored
Normal file
15
node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/.bin/semver
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
basedir=`dirname "$0"`
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
"$basedir/node" "$basedir/../semver/bin/semver" "$@"
|
||||
ret=$?
|
||||
else
|
||||
node "$basedir/../semver/bin/semver" "$@"
|
||||
ret=$?
|
||||
fi
|
||||
exit $ret
|
||||
7
node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/.bin/semver.cmd
generated
vendored
Normal file
7
node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/.bin/semver.cmd
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
@IF EXIST "%~dp0\node.exe" (
|
||||
"%~dp0\node.exe" "%~dp0\..\semver\bin\semver" %*
|
||||
) ELSE (
|
||||
@SETLOCAL
|
||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
node "%~dp0\..\semver\bin\semver" %*
|
||||
)
|
||||
8
node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/mkdirp/.travis.yml
generated
vendored
Normal file
8
node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/mkdirp/.travis.yml
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- "0.8"
|
||||
- "0.10"
|
||||
- "0.12"
|
||||
- "iojs"
|
||||
before_install:
|
||||
- npm install -g npm@~1.4.6
|
||||
21
node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/mkdirp/LICENSE
generated
vendored
Normal file
21
node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/mkdirp/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
Copyright 2010 James Halliday (mail@substack.net)
|
||||
|
||||
This project is free software released under the MIT/X11 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.
|
||||
33
node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/mkdirp/bin/cmd.js
generated
vendored
Normal file
33
node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/mkdirp/bin/cmd.js
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
var mkdirp = require('../');
|
||||
var minimist = require('minimist');
|
||||
var fs = require('fs');
|
||||
|
||||
var argv = minimist(process.argv.slice(2), {
|
||||
alias: { m: 'mode', h: 'help' },
|
||||
string: [ 'mode' ]
|
||||
});
|
||||
if (argv.help) {
|
||||
fs.createReadStream(__dirname + '/usage.txt').pipe(process.stdout);
|
||||
return;
|
||||
}
|
||||
|
||||
var paths = argv._.slice();
|
||||
var mode = argv.mode ? parseInt(argv.mode, 8) : undefined;
|
||||
|
||||
(function next () {
|
||||
if (paths.length === 0) return;
|
||||
var p = paths.shift();
|
||||
|
||||
if (mode === undefined) mkdirp(p, cb)
|
||||
else mkdirp(p, mode, cb)
|
||||
|
||||
function cb (err) {
|
||||
if (err) {
|
||||
console.error(err.message);
|
||||
process.exit(1);
|
||||
}
|
||||
else next();
|
||||
}
|
||||
})();
|
||||
12
node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/mkdirp/bin/usage.txt
generated
vendored
Normal file
12
node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/mkdirp/bin/usage.txt
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
usage: mkdirp [DIR1,DIR2..] {OPTIONS}
|
||||
|
||||
Create each supplied directory including any necessary parent directories that
|
||||
don't yet exist.
|
||||
|
||||
If the directory already exists, do nothing.
|
||||
|
||||
OPTIONS are:
|
||||
|
||||
-m, --mode If a directory needs to be created, set the mode as an octal
|
||||
permission string.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user