summaryrefslogtreecommitdiff
path: root/src/node_object_wrap.h
AgeCommit message (Collapse)Author
2019-04-26src: apply clang-tidy modernize-deprecated-headers found by Jenkins CIgengjiawen
PR-URL: https://github.com/nodejs/node/pull/27279 Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-03-15src: remove usage of deprecated IsNearDeathMichaël Zasso
Refs: https://github.com/v8/v8/commit/06193b0b796124eb53bd8779965db61b4f82c770 PR-URL: https://github.com/nodejs/node/pull/26630 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-10src: remove redundant voidgengjiawen
PR-URL: https://github.com/nodejs/node/pull/26003 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-04-22src: remove `MarkIndependent()` callsAnna Henningsen
The method has been deprecated in upstream V8, with messaging indicating that it is the default for handles to be independent now anyway. PR-URL: https://github.com/nodejs/node/pull/20108 Refs: https://github.com/v8/v8/commit/71ad48fb8f214e80518ba0419796e4c571351255 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2017-03-10meta: restore original copyright headerJames M Snell
A prior io.js era commit inappropriately removed the original copyright statements from the source. This restores those in any files still remaining from that edit. Ref: https://github.com/nodejs/TSC/issues/174 Ref: https://github.com/nodejs/node/pull/10599 PR-URL: https://github.com/nodejs/node/pull/10155 Note: This PR was required, reviewed-by and approved by the Node.js Foundation Legal Committee and the TSC. There is no `Approved-By:` meta data.
2016-03-03src: replace deprecated SetWeak in object_wrapAli Ijaz Sheikh
Migrate node_object_wrap.h to the new SetWeak API. PR-URL: https://github.com/nodejs/node/pull/5494 Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com>
2015-09-06src: replace usage of v8::Handle with v8::LocalMichaël Zasso
v8::Handle is deprecated: https://codereview.chromium.org/1224623004 PR-URL: https://github.com/nodejs/io.js/pull/2202 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-08-05doc: multiple documentation updates cherry picked from v0.12James M Snell
* doc: improve http.abort description * doc: mention that mode is ignored if file exists * docs: Fix default options for fs.createWriteStream() * Documentation update about Buffer initialization * doc: add a note about readable in flowing mode * doc: Document http.request protocol option * doc, comments: Grammar and spelling fixes * updated documentation for fs.createReadStream * Update child_process.markdown, spelling * doc: Clarified read method with specified size argument. * docs:events clarify emitter.listener() behavior * doc: two minor stream doc improvements * doc: clarify Readable._read and Readable.push * doc: stream.unshift does not reset reading state * doc: readable event clarification * doc: additional refinement to readable event Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noorduis <ben@strongloop.com> PR-URL: https://github.com/nodejs/io.js/pull/2302
2015-02-18src: fix add-on builds, partially revert 8aed9d66Ben Noordhuis
Commit 8aed9d66 ("src: cleanup `Isolate::GetCurrent()`") breaks building add-ons because of the following: In file included from ../node_modules/nan/nan.h:27:0, from ../src/binding.cc:18: /home/bnoordhuis/src/v1.x/src/node_object_wrap.h: In member function 'v8::Local<v8::Object> node::ObjectWrap::handle()': /home/bnoordhuis/src/v1.x/src/node_object_wrap.h:39:46: error: base operand of '->' has non-pointer type 'v8::Persistent<v8::Object>' return v8::Local<v8::Object>::New(handle_->GetIsolate(), persistent()); Mea culpa, I was one of the reviewers. PR-URL: https://github.com/iojs/io.js/pull/868 Reviewed-By: Vladimir Kurchatkin <vladimir.kurchatkin@gmail.com>
2015-02-11src: cleanup `Isolate::GetCurrent()`Vladimir Kurchatkin
PR-URL: https://github.com/iojs/io.js/pull/807 Reviewed-by: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2015-01-12Remove excessive copyright/license boilerplateisaacs
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.
2014-03-14src, test: fix up ObjectWrap, `make test-addons`Ben Noordhuis
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.
2014-03-13src: update to v8 3.24 APIsFedor Indutny
2013-10-29win: fix ObjectWrap for latest v8Scott Blomquist
We need to keep ObjectWrap around for module authors (we think), but v8 3.21 broke node_object_wrap.h with respect to MSVC. Coincidentally, we no longer use ObjectWrap at all in core, and native modules might as well use their own entirely internal implementation if they need it.
2013-10-17cpplint: disallow if one-linersFedor Indutny
2013-09-06src: fix multi-base class ObjectWrap::Unwrap<T>()Ben Noordhuis
Fix pointer unwrapping when T is a class with more than one base class. Before this commit, the wrapped void* pointer was cast directly to T* without going through ObjectWrap* first, possibly leading to a class instance pointer that points to the wrong vtable. This change required some cleanup in various files; some classes used private rather than public inheritance, others didn't derive from ObjectWrap at all... Fixes #6188.
2013-07-31src: lint c++ codeFedor Indutny
2013-07-06lib, src: upgrade after v8 api changeBen Noordhuis
This is a big commit that touches just about every file in the src/ directory. The V8 API has changed in significant ways. The most important changes are: * Binding functions take a const v8::FunctionCallbackInfo<T>& argument rather than a const v8::Arguments& argument. * Binding functions return void rather than v8::Handle<v8::Value>. The return value is returned with the args.GetReturnValue().Set() family of functions. * v8::Persistent<T> no longer derives from v8::Handle<T> and no longer allows you to directly dereference the object that the persistent handle points to. This means that the common pattern of caching oft-used JS values in a persistent handle no longer quite works, you first need to reconstruct a v8::Local<T> from the persistent handle with the Local<T>::New(isolate, persistent) factory method. A handful of (internal) convenience classes and functions have been added to make dealing with the new API a little easier. The most visible one is node::Cached<T>, which wraps a v8::Persistent<T> with some template sugar. It can hold arbitrary types but so far it's exclusively used for v8::Strings (which was by far the most commonly cached handle type.)
2013-06-12src: upgrade after v8 api changeBen Noordhuis
The prototype of v8::Persistent<T>::MakeWeak() has changed. Update the code in src/ to follow suit.
2013-06-07src: unexport node_isolateBen Noordhuis
Commit 0bba5902 accidentally (or maybe erroneously) added node_isolate to src/node.h and src/node_object_wrap.h. Undo that, said variable is not for public consumption. Add-on authors should use v8::Isolate::GetCurrent() instead. I missed that while reviewing. Mea culpa. Fixes #5639.
2013-04-12Merge branch 'v0.10'Fedor Indutny
Conflicts: ChangeLog deps/uv/src/version.c src/node.h src/node_crypto.cc src/node_crypto_bio.cc src/node_crypto_bio.h src/node_object_wrap.h src/node_version.h
2013-04-10src: add node_isolate to remaining scopesTrevor Norris
2013-04-10src: don't SetInternalField() in ObjectWrap dtorBen Noordhuis
Call SetPointerInInternalField(0, NULL) rather than SetInternalField(0, Undefined()). Fixes the following spurious NULL pointer dereference in debug builds: #0 0x03ad2821 in v8::internal::FixedArrayBase::length () #1 0x03ad1dfc in v8::internal::FixedArray::get () #2 0x03ae05dd in v8::internal::Context::global_object () #3 0x03b6b87d in v8::internal::Context::builtins () #4 0x03ae1871 in v8::internal::Isolate::js_builtins_object () #5 0x03ab4fab in v8::CallV8HeapFunction () #6 0x03ab4d4a in v8::Value::Equals () #7 0x03b4f38b in CheckEqualsHelper () #8 0x03ac0f4b in v8::Object::SetInternalField () #9 0x06a99ddd in node::ObjectWrap::~ObjectWrap () #10 0x06a8b051 in node::Buffer::~Buffer () #11 0x06a8afbb in node::Buffer::~Buffer () #12 0x06a8af5e in node::Buffer::~Buffer () #13 0x06a9e569 in node::ObjectWrap::WeakCallback ()
2013-03-20bindings: update apiTrevor Norris
All compile time warnings about using deprecated APIs have been suppressed by updating node's API. Though there are still many function calls that can accept Isolate, and still need to be updated. node_isolate had to be added as an extern variable in node.h and node_object_wrap.h Also a couple small fixes for Error handling. Before v8 3.16.6 the error stack message was lazily written when it was needed, which allowed you to change the message after instantiation. Then the stack would be written with the new message the first time it was accessed. Though that has changed. Now it creates the stack message on instantiation. So setting a different message afterwards won't be displayed. This is not a complete fix for the problem. Getting error without any message isn't very useful.
2013-02-25src, test: downgrade to v8 3.14 apiBen Noordhuis
2013-01-04object_wrap: add missing HandleScopeFedor Indutny
by Sven Panne's suggestion, see [0] for details. [0]: https://code.google.com/p/v8/issues/detail?id=2468
2013-01-02bindings: update to new v8 apisFedor Indutny
GetPointerFromInternalField() is deprecated now, we should use GetAlignedPointerFromInternalField().
2012-08-20unix: don't explicitly instantiate v8::Persistent<x> templatesBert Belder
These explicit instantiations were added to make MSVC happy. It turns out that some older versions of gcc and llvm now complain about duplicate symbols, so we instantiate these templates only when MSVC is used.
2012-08-17windows: avoid MSVC warnings about templates not having a dll interfaceBert Belder
2012-03-10core: use proper #include directivesBen Noordhuis
2011-11-17Fixes #2140. Fix illumos build.Ryan Dahl
2011-11-17Windows: make Buffer and ObjectWrap available to compiled extensionsBert Belder
Closes GH-2036
2011-09-05ObjectWraps should be MarkIndependentRyan Dahl
2011-03-14Update copyright headersRyan Dahl
2010-10-04ClearWeak on ObjectWraps. I /think/ this is the correct semanticsRyan Dahl
2010-09-13Fix style in node_object_wrap.hRyan Dahl
2010-09-09Use SetPointerInInternalFieldRyan Dahl
2010-06-04Allow ObjectWrap destructors before Wrap()Ryan Dahl
2010-05-24Create a public Buffer constructor for use in addons.Ryan Dahl
2010-01-27ObjectWrap fixed - buffers working!Ryan Dahl
Hot bug fix from net2 branch.
2009-12-07Attach/Detach -> Ref/UnrefRyan Dahl
2009-10-27Prefix all source files with node_Ryan Dahl