Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
Merge nodejs/master into xplat
Browse files Browse the repository at this point in the history
Merge 5de722a as of 2017/05/18.
This is an automatically created merge. For any problems please
contact @kunalspathak
  • Loading branch information
chakrabot committed May 18, 2017
2 parents d07825c + 5de722a commit 9752ce1
Show file tree
Hide file tree
Showing 7 changed files with 98 additions and 8 deletions.
6 changes: 5 additions & 1 deletion doc/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -411,14 +411,18 @@ Node options that are allowed are:
- `--enable-fips`
- `--force-fips`
- `--icu-data-dir`
- `--inspect-brk`
- `--inspect-port`
- `--inspect`
- `--napi-modules`
- `--no-deprecation`
- `--no-warnings`
- `--openssl-config`
- `--prof-process`
- `--redirect-warnings`
- `--require`, `-r`
- `--throw-deprecation`
- `--trace-deprecation`
- `--trace-events-categories`
- `--trace-events-enabled`
- `--trace-sync-io`
- `--trace-warnings`
Expand Down
4 changes: 2 additions & 2 deletions doc/changelogs/CHANGELOG_V4.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
</tr>
<tr>
<td valign="top">
<a href="#4.8.1">4.8.3</a><br/>
<a href="#4.8.1">4.8.2</a><br/>
<a href="#4.8.3">4.8.3</a><br/>
<a href="#4.8.2">4.8.2</a><br/>
<a href="#4.8.1">4.8.1</a><br/>
<a href="#4.8.0">4.8.0</a><br/>
<a href="#4.7.3">4.7.3</a><br/>
Expand Down
14 changes: 9 additions & 5 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3774,25 +3774,29 @@ static void CheckIfAllowedInEnv(const char* exe, bool is_env,

static const char* whitelist[] = {
// Node options
"-r", "--require",
"--require", "-r",
"--inspect",
"--inspect-brk",
"--inspect-port",
"--no-deprecation",
"--trace-deprecation",
"--throw-deprecation",
"--no-warnings",
"--napi-modules",
"--trace-warnings",
"--redirect-warnings",
"--trace-deprecation",
"--trace-sync-io",
"--trace-events-enabled",
"--trace-events-categories",
"--track-heap-objects",
"--throw-deprecation",
"--zero-fill-buffers",
"--v8-pool-size",
"--use-openssl-ca",
"--use-bundled-ca",
"--use-openssl-ca",
"--enable-fips",
"--force-fips",
"--openssl-config",
"--icu-data-dir",
"--napi-modules",

// V8 options
"--max_old_space_size",
Expand Down
8 changes: 8 additions & 0 deletions test/addons-napi/test_general/binding.gyp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"targets": [
{
"target_name": "test_general",
"sources": [ "test_general.c" ]
}
]
}
32 changes: 32 additions & 0 deletions test/addons-napi/test_general/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
'use strict';

const common = require('../../common');
const test_general = require(`./build/${common.buildType}/test_general`);
const assert = require('assert');

const val1 = '1';
const val2 = 1;
const val3 = 1;

class BaseClass {
}

class ExtendedClass extends BaseClass {
}

const baseObject = new BaseClass();
const extendedObject = new ExtendedClass();

// test napi_strict_equals
assert.ok(test_general.testStrictEquals(val1, val1));
assert.strictEqual(test_general.testStrictEquals(val1, val2), false);
assert.ok(test_general.testStrictEquals(val2, val3));

// test napi_get_prototype
assert.strictEqual(test_general.testGetPrototype(baseObject),
Object.getPrototypeOf(baseObject));
assert.strictEqual(test_general.testGetPrototype(extendedObject),
Object.getPrototypeOf(extendedObject));
assert.ok(test_general.testGetPrototype(baseObject) !==
test_general.testGetPrototype(extendedObject),
'Prototypes for base and extended should be different');
38 changes: 38 additions & 0 deletions test/addons-napi/test_general/test_general.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#include <node_api.h>
#include "../common.h"

napi_value testStrictEquals(napi_env env, napi_callback_info info) {
size_t argc = 2;
napi_value args[2];
NAPI_CALL(env, napi_get_cb_info(env, info, &argc, args, NULL, NULL));

bool bool_result;
napi_value result;
NAPI_CALL(env, napi_strict_equals(env, args[0], args[1], &bool_result));
NAPI_CALL(env, napi_get_boolean(env, bool_result, &result));

return result;
}

napi_value testGetPrototype(napi_env env, napi_callback_info info) {
size_t argc = 1;
napi_value args[1];
NAPI_CALL(env, napi_get_cb_info(env, info, &argc, args, NULL, NULL));

napi_value result;
NAPI_CALL(env, napi_get_prototype(env, args[0], &result));

return result;
}

void Init(napi_env env, napi_value exports, napi_value module, void* priv) {
napi_property_descriptor descriptors[] = {
DECLARE_NAPI_PROPERTY("testStrictEquals", testStrictEquals),
DECLARE_NAPI_PROPERTY("testGetPrototype", testGetPrototype),
};

NAPI_CALL_RETURN_VOID(env, napi_define_properties(
env, exports, sizeof(descriptors) / sizeof(*descriptors), descriptors));
}

NAPI_MODULE(addon, Init)
4 changes: 4 additions & 0 deletions test/parallel/test-tls-lookup.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
'use strict';
const common = require('../common');
if (!common.hasCrypto) {
common.skip('missing crypto');
return;
}
const assert = require('assert');
const tls = require('tls');

Expand Down

0 comments on commit 9752ce1

Please sign in to comment.