Pull Request #3 [pull] master from nodejs:master

This change reduces the places where we declare private functions with
the `napi_callback` signature for the purpose of using them with C++
callbacks passed as template arguments. We basically have 4 types:

1. static with `void` return
2. static with `napi_value` return
3. instance with `void` return
4. instance with `napi_value` return

We can use one of these four calling patterns in the following places
where we accept callbacks as template arguments:
* `Napi::Function` (1. and 2.)
* `Napi::PropertyDescriptor` (1. for the setter, 2. for the getter)
* `Napi::InstanceWrap<T>` (3., 4. for instance methods, 4. for
instance getters)
* `Napi::ObjectWrap<T>` (1., 2. for static methods, 2. for static
getters)

In the case of `InstanceWrap<T>` and `ObjectWrap<T>` instance resp.
static property descriptors we can also remove the infrastructure
designed to allow for optional getters (`GetterTag` resp.
`StaticGetterTag`) because the API for specifying instance resp. class
property descriptors does not allow one to omit the getter.

Signed-off-by: Gabriel Schulhof <gabriel.schulhof@intel.com>
PR-URL: https://github.com/nodejs/node-addon-api/pull/786
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>

 avatar pull[bot]

Pull request event #4 errored

  • Ran for
  • Total time
  • New branch build
kadirselcuk/node-addon-api:.travis.yml@b4995f6
language: c++
compiler:
  - clang
  - gcc
# For Linux, use an Ubuntu 14 image
dist: trusty
os:
  - linux
  - osx
env:
  global:
    # https://github.com/jasongin/nvs/blob/master/doc/CI.md
    - NVS_VERSION=1.4.2
  matrix:
    - NODEJS_VERSION=node/10
    - NODEJS_VERSION=node/12
    - NODEJS_VERSION=node/14
    - NODEJS_VERSION=nightly
matrix:
  fast_finish: true
  allow_failures:
    - env: NODEJS_VERSION=nightly
sudo: false
cache:
  directories:
    - node_modules
    - $HOME/.npm
addons:
  apt:
    sources:
      - ubuntu-toolchain-r-test
    packages:
      - g++-4.9
before_install:
  # coveralls
  - pip2 install --user cpp-coveralls
  # compilers
  - if [ "$CXX" = "g++" -a "$TRAVIS_OS_NAME" = "linux" ]; then export CXX="g++-4.9" CC="gcc-4.9" AR="gcc-ar-4.9" RANLIB="gcc-ranlib-4.9" NM="gcc-nm-4.9" ; fi
  - if [ "$CXX" = "clang++" ]; then export NPMOPT=--clang=1 ; fi
  - export CFLAGS="$CFLAGS -O3 --coverage" LDFLAGS="$LDFLAGS --coverage"
  - echo "CFLAGS=\"$CFLAGS\" LDFLAGS=\"$LDFLAGS\""
  # nvs
  - git clone --branch v$NVS_VERSION --depth 1 https://github.com/jasongin/nvs ~/.nvs
  - . ~/.nvs/nvs.sh
  - nvs --version
  # node.js
  - nvs add $NODEJS_VERSION
  - nvs use $NODEJS_VERSION
  - node --version
  - npm --version
install:
  - npm install $NPMOPT
script:
  # Travis CI sets NVM_NODEJS_ORG_MIRROR, but it makes node-gyp fail to download headers for nightly builds.
  - unset NVM_NODEJS_ORG_MIRROR

  - npm test
after_success:
  - cpp-coveralls --gcov-options '\-lp' --build-root test/build --exclude test
Build Config
{
  "language": "cpp",
  "os": [
    "linux",
    "osx"
  ],
  "dist": "trusty",
  "compiler": [
    "clang",
    "gcc"
  ],
  "env": {
    "global": [
      {
        "NVS_VERSION": "1.4.2"
      }
    ],
    "jobs": [
      {
        "NODEJS_VERSION": "node/10"
      },
      {
        "NODEJS_VERSION": "node/12"
      },
      {
        "NODEJS_VERSION": "node/14"
      },
      {
        "NODEJS_VERSION": "nightly"
      }
    ]
  },
  "sudo": false,
  "cache": {
    "directories": [
      "node_modules",
      "$HOME/.npm"
    ]
  },
  "addons": {
    "apt": {
      "sources": [
        {
          "name": "ubuntu-toolchain-r-test"
        }
      ],
      "packages": [
        "g++-4.9"
      ]
    }
  },
  "before_install": [
    "pip2 install --user cpp-coveralls",
    "if [ \"$CXX\" = \"g++\" -a \"$TRAVIS_OS_NAME\" = \"linux\" ]; then export CXX=\"g++-4.9\" CC=\"gcc-4.9\" AR=\"gcc-ar-4.9\" RANLIB=\"gcc-ranlib-4.9\" NM=\"gcc-nm-4.9\" ; fi",
    "if [ \"$CXX\" = \"clang++\" ]; then export NPMOPT=--clang=1 ; fi",
    "export CFLAGS=\"$CFLAGS -O3 --coverage\" LDFLAGS=\"$LDFLAGS --coverage\"",
    "echo \"CFLAGS=\\\"$CFLAGS\\\" LDFLAGS=\\\"$LDFLAGS\\\"\"",
    "git clone --branch v$NVS_VERSION --depth 1 https://github.com/jasongin/nvs ~/.nvs",
    ". ~/.nvs/nvs.sh",
    "nvs --version",
    "nvs add $NODEJS_VERSION",
    "nvs use $NODEJS_VERSION",
    "node --version",
    "npm --version"
  ],
  "install": [
    "npm install $NPMOPT"
  ],
  "script": [
    "unset NVM_NODEJS_ORG_MIRROR",
    "npm test"
  ],
  "after_success": [
    "cpp-coveralls --gcov-options '\\-lp' --build-root test/build --exclude test"
  ],
  "jobs": {
    "fast_finish": true,
    "allow_failures": [
      {
        "env": [
          {
            "NODEJS_VERSION": "nightly"
          }
        ]
      }
    ]
  }
}