summaryrefslogtreecommitdiff
path: root/src/tty_wrap.cc
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2014-10-11 16:24:12 +0200
committerFedor Indutny <fedor@indutny.com>2014-10-12 02:09:16 +0400
commit97585b0d7ab0084d90faf6bded275b902d76857a (patch)
tree26853d875786c014e2e9ef5ed2ec18f7ed601775 /src/tty_wrap.cc
parentb2e519983f1e92a874a74c11e82027955ef8909a (diff)
downloadandroid-node-v8-97585b0d7ab0084d90faf6bded275b902d76857a.tar.gz
android-node-v8-97585b0d7ab0084d90faf6bded275b902d76857a.tar.bz2
android-node-v8-97585b0d7ab0084d90faf6bded275b902d76857a.zip
src: remove unnecessary HandleScopes
API callback functions don't need to create a v8::HandleScope instance because V8 already creates one in the JS->C++ adapter frame. PR-URL: https://github.com/node-forward/node/pull/16 Reviewed-By: Fedor Indutny <fedor@indutny.com>
Diffstat (limited to 'src/tty_wrap.cc')
-rw-r--r--src/tty_wrap.cc10
1 files changed, 0 insertions, 10 deletions
diff --git a/src/tty_wrap.cc b/src/tty_wrap.cc
index 34ee14dec7..ec4ad82a72 100644
--- a/src/tty_wrap.cc
+++ b/src/tty_wrap.cc
@@ -39,7 +39,6 @@ using v8::Function;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
using v8::Handle;
-using v8::HandleScope;
using v8::Integer;
using v8::Local;
using v8::Object;
@@ -100,7 +99,6 @@ uv_tty_t* TTYWrap::UVHandle() {
void TTYWrap::GuessHandleType(const FunctionCallbackInfo<Value>& args) {
Environment* env = Environment::GetCurrent(args.GetIsolate());
- HandleScope scope(env->isolate());
int fd = args[0]->Int32Value();
assert(fd >= 0);
@@ -123,8 +121,6 @@ void TTYWrap::GuessHandleType(const FunctionCallbackInfo<Value>& args) {
void TTYWrap::IsTTY(const FunctionCallbackInfo<Value>& args) {
- Environment* env = Environment::GetCurrent(args.GetIsolate());
- HandleScope scope(env->isolate());
int fd = args[0]->Int32Value();
assert(fd >= 0);
bool rc = uv_guess_handle(fd) == UV_TTY;
@@ -134,7 +130,6 @@ void TTYWrap::IsTTY(const FunctionCallbackInfo<Value>& args) {
void TTYWrap::GetWindowSize(const FunctionCallbackInfo<Value>& args) {
Environment* env = Environment::GetCurrent(args.GetIsolate());
- HandleScope scope(env->isolate());
TTYWrap* wrap = Unwrap<TTYWrap>(args.Holder());
assert(args[0]->IsArray());
@@ -153,18 +148,13 @@ void TTYWrap::GetWindowSize(const FunctionCallbackInfo<Value>& args) {
void TTYWrap::SetRawMode(const FunctionCallbackInfo<Value>& args) {
- Environment* env = Environment::GetCurrent(args.GetIsolate());
- HandleScope scope(env->isolate());
-
TTYWrap* wrap = Unwrap<TTYWrap>(args.Holder());
-
int err = uv_tty_set_mode(&wrap->handle_, args[0]->IsTrue());
args.GetReturnValue().Set(err);
}
void TTYWrap::New(const FunctionCallbackInfo<Value>& args) {
- HandleScope handle_scope(args.GetIsolate());
Environment* env = Environment::GetCurrent(args.GetIsolate());
// This constructor should not be exposed to public javascript.