summaryrefslogtreecommitdiff
path: root/src/tty_wrap.cc
AgeCommit message (Collapse)Author
2014-04-02node: add signature to SET_PROTOTYPE_METHODC. Scott Ananian
This prevents segfaults when a native method is reassigned to a different object (which corrupts args.This()). When unwrapping, clients should use args.Holder() instead of args.This(). Closes #6690. Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-03-13src: update to v8 3.24 APIsFedor Indutny
2014-02-22src: remove `node_isolate` from sourceFedor Indutny
fix #6899
2014-02-05async_wrap: add provider types/pass to constructorTrevor Norris
These will be used to allow users to filter for which types of calls they wish their callbacks to run. Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
2014-01-27node: register modules from DSO constructorsKeith M Wesolowski
Built-in modules should be automatically registered, replacing the static module list. Add-on modules should also be automatically registered via DSO constructors. This improves flexibility in adding built-in modules and is also a prerequisite to pure-C addon modules.
2013-11-11src: fix Environment::GetCurrent() usageBen Noordhuis
Create a HandleScope before calling the Environment::GetCurrent() that takes a v8::Isolate* as an argument because it creates a handle with the call to v8::Isolate::CurrentContext().
2013-10-29src: shorten Object{Wrap,Unwrap}Trevor Norris
Going back to the original names of Wrap/Unwrap now that most all the class members that duplicate the name and functionality have been removed.
2013-10-29src: don't use class specific Unwrap methodsTrevor Norris
Instead use the template functions in util.h.
2013-10-29src: use function to get internal pointerTrevor Norris
Remove the NODE_{WRAP,UNWRAP} macros and instead use template functions.
2013-09-06src: add multi-context supportBen Noordhuis
This commit makes it possible to use multiple V8 execution contexts within a single event loop. Put another way, handle and request wrap objects now "remember" the context they belong to and switch back to that context when the time comes to call into JS land. This could have been done in a quick and hacky way by calling v8::Object::GetCreationContext() on the wrap object right before making a callback but that leaves a fairly wide margin for bugs. Instead, we make the context explicit through a new Environment class that encapsulates everything (or almost everything) that belongs to the context. Variables that used to be a static or a global are now members of the aforementioned class. An additional benefit is that this approach should make it relatively straightforward to add full isolate support in due course. There is no JavaScript API yet but that will be added in the near future. This work was graciously sponsored by GitHub, Inc.
2013-08-12src: fix build break from generic macro nameTrevor Norris
WRAP is too generic a macro name and causes the build to fail from conflicts. They have been prepended with NODE_.
2013-08-12src: centralize class wrap/unwrapTrevor Norris
While almost all cases were handled by simple WRAP/UNWRAP macros, this extends those to cover all known occurrences.
2013-08-09src: use v8::String::NewFrom*() functionsBen Noordhuis
* Change calls to String::New() and String::NewSymbol() to their respective one-byte, two-byte and UTF-8 counterparts. * Add a FIXED_ONE_BYTE_STRING macro that takes a string literal and turns it into a v8::Local<v8::String>. * Add helper functions that make v8::String::NewFromOneByte() easier to work with. Said function expects a `const uint8_t*` but almost every call site deals with `const char*` or `const unsigned char*`. Helps us avoid doing reinterpret_casts all over the place. * Code that handles file system paths keeps using UTF-8 for backwards compatibility reasons. At least now the use of UTF-8 is explicit. * Remove v8::String::NewSymbol() entirely. Almost all call sites were effectively minor de-optimizations. If you create a string only once, there is no point in making it a symbol. If you are create the same string repeatedly, it should probably be cached in a persistent handle.
2013-07-31src: more lint after cpplint tighteningBen Noordhuis
Commit 847c6d9 adds a 'project headers before system headers' check to cpplint. Update the files in src/ to make the linter pass again.
2013-07-31src: lint c++ codeFedor Indutny
2013-07-20src, lib: update after internal api changeBen Noordhuis
Libuv now returns errors directly. Make everything in src/ and lib/ follow suit. The changes to lib/ are not strictly necessary but they remove the need for the abominations that are process._errno and node::SetErrno().
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-17src: clean up `using` directivesBen Noordhuis
Remove the unused ones and alphabetically sort the ones that remain.
2013-06-15process: abstract out HandleToStreamFedor Indutny
Originally contributed by @tjfontaine, but modified to be faster and more generic.
2013-05-30src: replace c-style casts with c++-style castsBen Noordhuis
2013-03-21Merge remote-tracking branch 'ry/v0.10' into masterisaacs
Conflicts: src/node.cc src/node_version.h
2013-03-20src: pass Isolate to all applicable apiTrevor Norris
Update the api to pass node_isolate to all supported methods. Much thanks to Ben Noordhuis and his work in 51f6e6a.
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-03-14deps: upgrade libuv to 7b66ea1Ben Noordhuis
2013-02-25src, test: downgrade to v8 3.14 apiBen Noordhuis
2013-02-13stream_wrap, udp_wrap: add read-only fd propertyBen Noordhuis
Expose the file descriptor as a read-only property on the internal handle objects. Intended for debugging purposes, not part of the API proper. The property is always null on Windows. Fixes #4754.
2013-01-07src: pass node_isolate to Undefined()Ben Noordhuis
2013-01-07src: pass node_isolate to True() and False()Ben Noordhuis
2013-01-07src: pass node_isolate to Integer::NewBen Noordhuis
2013-01-02bindings: update to new v8 apisFedor Indutny
GetPointerFromInternalField() is deprecated now, we should use GetAlignedPointerFromInternalField().
2012-07-12net: fix net.Server.listen({fd:x}) error reportingBen Noordhuis
* don't assert when fd isn't an open file descriptor * don't die with a ReferenceError when fd isn't a file descriptor you can listen() on Fixes #3699.
2012-06-01child_process: new stdio API for .spawn() methodFedor Indutny
2012-05-22deps: upgrade libuv to a478847Ben Noordhuis
The event loop's reference counting scheme in this version of libuv has changed. Update the libuv bindings to reflect that fact.
2012-05-21Make UNWRAP macro generic.Oleg Efimov
2012-05-09Net.js: fix UCS2 write crash due to inconsistent namingBert Belder
2012-05-09Optimize writing strings with Socket.writeBert Belder
2012-03-10core: use proper #include directivesBen Noordhuis
2012-02-06Revert support for isolates.Ben Noordhuis
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.
2011-12-29Add node::Loop() and don't inc node_isolate.h in *.ccRyan Dahl
node::Loop() replaces the NODE_LOOP macro. This avoids hitting v8::Isolate::GetCurrent() for each loop lookup when HAVE_ISOLATE==0
2011-12-29Remove node_isolate.h from node.hRyan Dahl
2011-12-29isolates: isolate-ify the main loopBen Noordhuis
2011-12-05Fix #2257 pause/resume semantics for stdinisaacs
This makes it so that the stdin TTY-wrap stream gets ref'ed on .resume() and unref'ed on .pause() The semantics of the names "pause" and "resume" are a bit weird, but the important thing is that this corrects an API change from 0.4 -> 0.6 which made it impossible to read from stdin multiple times, without knowing when it might end up being closed. If no one has it open, this lets the process die naturally. LGTM'd by @ry
2011-11-09Remove stray NODE_MODULE() semi-colons.Ben Noordhuis
2011-11-04Fix line endings and trailing whitespaceBert Belder
2011-11-02Add missing copyright headersRyan Dahl
2011-10-19Display sys_errno when UV_UNKNOWN is returnedRyan Dahl
2011-10-10Upgrade libuv to 5656e3Ryan Dahl
This modifies the TTYWrap constructor to add another argument specifying if it's a readable or writable TTY . That is stdin or stdout. If a TTYWrap is not readable then writes to it are blocking. This makes process.stdout blocking.
2011-09-27Move process.stdout unref hack to handle_wrap.ccRyan Dahl
See #1726
2011-09-27scope.Close in GuessHandleType; don't use uv_is_ttyRyan Dahl
2011-09-27Bind uv_tty_get_winsizeRyan Dahl