diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2009-11-18 15:25:58 +0100 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2009-11-18 15:28:54 +0100 |
commit | 728d8a37f471afaeaa6af19823f9da8c41f1f65a (patch) | |
tree | 21e014089ff0bfb7d493691620ab9eee51176d28 /deps/v8/src/scopes.cc | |
parent | 8195e0f7232fed3d6a3a2cc8464fec5e36f4433c (diff) | |
download | node-728d8a37f471afaeaa6af19823f9da8c41f1f65a.tar.gz |
Upgrade v8 to 2.0
(With just one change: remove -Werror)
Diffstat (limited to 'deps/v8/src/scopes.cc')
-rw-r--r-- | deps/v8/src/scopes.cc | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/deps/v8/src/scopes.cc b/deps/v8/src/scopes.cc index 25873fac1..7da06cdbc 100644 --- a/deps/v8/src/scopes.cc +++ b/deps/v8/src/scopes.cc @@ -42,7 +42,7 @@ class ZoneAllocator: public Allocator { /* nothing to do */ virtual ~ZoneAllocator() {} - virtual void* New(size_t size) { return Zone::New(size); } + virtual void* New(size_t size) { return Zone::New(static_cast<int>(size)); } /* ignored - Zone is freed in one fell swoop */ virtual void Delete(void* p) {} @@ -540,11 +540,11 @@ Variable* Scope::NonLocal(Handle<String> name, Variable::Mode mode) { // Lookup a variable starting with this scope. The result is either -// the statically resolved (local!) variable belonging to an outer scope, -// or NULL. It may be NULL because a) we couldn't find a variable, or b) -// because the variable is just a guess (and may be shadowed by another -// variable that is introduced dynamically via an 'eval' call or a 'with' -// statement). +// the statically resolved variable belonging to an outer scope, or +// NULL. It may be NULL because a) we couldn't find a variable, or b) +// because the variable is just a guess (and may be shadowed by +// another variable that is introduced dynamically via an 'eval' call +// or a 'with' statement). Variable* Scope::LookupRecursive(Handle<String> name, bool inner_lookup, Variable** invalidated_local) { @@ -598,9 +598,11 @@ Variable* Scope::LookupRecursive(Handle<String> name, if (inner_lookup) var->is_accessed_from_inner_scope_ = true; - // If the variable we have found is just a guess, invalidate the result. + // If the variable we have found is just a guess, invalidate the + // result. If the found variable is local, record that fact so we + // can generate fast code to get it if it is not shadowed by eval. if (guess) { - *invalidated_local = var; + if (!var->is_global()) *invalidated_local = var; var = NULL; } |