Many test modules load assert but do not use it. This change removes
those instances.
It also removes a handful of other unused variables when they were
nearby.
PR-URL: https://github.com/nodejs/node/pull/4438
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Use path join to construct the path instead of concatenating strings.
Replace backslash with double backslash so that they are escaped
correctly in the string passed to REPL.
PR-URL: https://github.com/nodejs/node/pull/3608
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
In preparation for a lint rule that will enforce `throw new Error()`
over `throw Error()`, fix the handful of instances in the code that
use `throw Error()`.
PR-URL: https://github.com/nodejs/node/pull/3714
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Neuter external `nullptr` buffers, otherwise their contents will be
materialized on access, and the buffer instance will be internalized.
This leads to a crash like this:
v8::ArrayBuffer::Neuter Only externalized ArrayBuffers can be
neutered
Fix: #3619
PR-URL: https://github.com/nodejs/node/pull/3624
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Fix the following error message in windows using VS 2013:
LINK : fatal error LNK1194: cannot delay-load 'node.exe'
due to import of data symbol '"__declspec(dllimport)
const v8::OutputStream::`vftable'"
(__imp_??_7OutputStream@v8@@6B@)'; link without
/DELAYLOAD:node.exe
PR-URL: https://github.com/nodejs/node/pull/3572
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
`CallbackInfo` is now bound to `ArrayBuffer` instance, not `Uint8Array`,
therefore `SPREAD_ARG` will abort with:
Assertion failed: ((object)->IsUint8Array())
Make changes necessary to migrate it to `ArrayBuffer`.
See: https://github.com/nodejs/node/pull/3080#issuecomment-147502167
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/3329
FreeCallback should be invoked on the storage disposal (`ArrayBuffer`),
not when the view (`Uint8Array` or `Buffer`) is disposed. This causes
bug and crashes in addons which create buffers and store only slices of
them.
PR-URL: https://github.com/nodejs/node/pull/3198
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
common.js contains code that detects leaked variables.
In preparation for an eslint rule that will enforce loading common.js in
test files, load it everywhere it can be loaded and use an
`eslint-disable` comment for files that intentionally leak.
PR-URL: https://github.com/nodejs/node/pull/3157
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
When using require to load a native addon the path must be converted
into a long path, otherwise the addon will fail to be loaded on
windows if the path is longer than 260 characters.
PR-URL: https://github.com/nodejs/node/pull/2965
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Benjamin Gruenbaum <inglor@gmail.com>
Make `make test-addons` part of the `make test-ci` target.
Use order-only prerequisites to make generating and building the add-ons
concurrency-safe when $JOBS > 1 and fudge the dependency on $(NODE_EXE)
so that add-ons are only rebuilt when needed instead of all the time.
PR-URL: https://github.com/nodejs/node/pull/2428
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Rod Vagg <rod@vagg.org>
v8::Isolate::GetCurrent() is not exactly deprecated at this point but
its use is strongly discouraged. Update the addon tests so they no
longer use it.
PR-URL: https://github.com/nodejs/node/pull/2427
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Add files in test/addon to the `make cpplint` rule and fix up existing
style issues. Tests scraped from doc/api/addon.md are filtered out
because those are predominantly for illustrative purposes.
PR-URL: https://github.com/nodejs/node/pull/2427
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Upgrade the bundled V8 and update code in src/ and lib/ to the new API.
Notable backwards incompatible changes are the removal of the smalloc
module and dropped support for CESU-8 decoding. CESU-8 support can be
brought back if necessary by doing UTF-8 decoding ourselves.
This commit includes https://codereview.chromium.org/1192973004 to fix
a build error on python 2.6 systems. The original commit log follows:
Use optparse in js2c.py for python compatibility
Without this change, V8 won't build on RHEL/CentOS 6 because the
distro python is too old to know about the argparse module.
PR-URL: https://github.com/nodejs/io.js/pull/2022
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
The smalloc module is about to be deprecated and removed. Remove the
add-on test now so it's not forgotten about in the upcoming purge.
PR-URL: https://github.com/nodejs/io.js/pull/1835
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
The non-isolate version of node::FatalException() is deprecated, switch
to the version that takes an isolate as its first argument.
PR-URL: https://github.com/nodejs/io.js/pull/1793
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Enable linting for the test directory. A number of changes was made so
all tests conform the current rules used by lib and src directories. The
only exception for tests is that unreachable (dead) code is allowed.
test-fs-non-number-arguments-throw had to be excluded from the changes
because of a weird issue on Windows CI.
PR-URL: https://github.com/nodejs/io.js/pull/1721
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
node::Environment isn't accessible to user APIs, so extend smalloc to
also accept v8::Isolate.
Fixes: 75adde07 "src: remove `node_isolate` from source"
PR-URL: https://github.com/iojs/io.js/pull/905
Reviewed-by: Fedor Indutny <fedor@indutny.com>
The copyright and license notice is already in the LICENSE file. There
is no justifiable reason to also require that it be included in every
file, since the individual files are not individually distributed except
as part of the entire package.
The REPL global object lazy loads modules by placing getters for each.
This causes MakeDomainCallback() to be run if a native module is loaded
from the REPL, but if the domain module hasn't been loaded then there
are no enter/exit callbacks to be called. Causing an assert() to fail.
Fix the issue by conditionally running the callback instead of asserting
it is available. Also add "addon" test to verify the fix.
Fixes: #8231
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
V8 was upgraded from 3.22 to 3.24 in commit 1c7bf24. Upgrade source
files in test/addons/ and automatically generated tests from
doc/api/addons.markdown to the new V8 API.
This coincidentally fixes a bug in src/node_object_wrap.h where it was
still using the old V8 weak persistent handle interface, which is gone
in 3.24.
mainly to allow native addons to export single functions on
rather than being restricted to operating on an existing
object.
Init functions now receive exports as the first argument, like
before, but also the module object as the second argument, if they
support it.
Related to #4634
cc: @rvagg
It was decided that the performance benefits that isolates offer (faster spin-up
times for worker processes, faster inter-worker communication, possibly a lower
memory footprint) are not actual bottlenecks for most people and do not outweigh
the potential stability issues and intrusive changes to the code base that
first-class support for isolates requires.
Hence, this commit backs out all isolates-related changes.
Good bye, isolates. We hardly knew ye.