Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(907)

Side by Side Diff: src/scopes.h

Issue 7309002: Fix a bug in with and catch context allocation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/parser.cc ('k') | src/scopes.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 283
284 // Determine if we can use lazy compilation for this scope. 284 // Determine if we can use lazy compilation for this scope.
285 bool AllowsLazyCompilation() const; 285 bool AllowsLazyCompilation() const;
286 286
287 // True if the outer context of this scope is always the global context. 287 // True if the outer context of this scope is always the global context.
288 bool HasTrivialOuterContext() const; 288 bool HasTrivialOuterContext() const;
289 289
290 // The number of contexts between this and scope; zero if this == scope. 290 // The number of contexts between this and scope; zero if this == scope.
291 int ContextChainLength(Scope* scope); 291 int ContextChainLength(Scope* scope);
292 292
293 // Find the first function, global, or eval scope. This is the scope
294 // where var declarations will be hoisted to in the implementation.
295 Scope* DeclarationScope();
296
293 // --------------------------------------------------------------------------- 297 // ---------------------------------------------------------------------------
294 // Strict mode support. 298 // Strict mode support.
295 bool IsDeclared(Handle<String> name) { 299 bool IsDeclared(Handle<String> name) {
296 // During formal parameter list parsing the scope only contains 300 // During formal parameter list parsing the scope only contains
297 // two variables inserted at initialization: "this" and "arguments". 301 // two variables inserted at initialization: "this" and "arguments".
298 // "this" is an invalid parameter name and "arguments" is invalid parameter 302 // "this" is an invalid parameter name and "arguments" is invalid parameter
299 // name in strict mode. Therefore looking up with the map which includes 303 // name in strict mode. Therefore looking up with the map which includes
300 // "this" and "arguments" in addition to all formal parameters is safe. 304 // "this" and "arguments" in addition to all formal parameters is safe.
301 return variables_.Lookup(name) != NULL; 305 return variables_.Lookup(name) != NULL;
302 } 306 }
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 } 431 }
428 432
429 void SetDefaults(Type type, 433 void SetDefaults(Type type,
430 Scope* outer_scope, 434 Scope* outer_scope,
431 Handle<SerializedScopeInfo> scope_info); 435 Handle<SerializedScopeInfo> scope_info);
432 }; 436 };
433 437
434 } } // namespace v8::internal 438 } } // namespace v8::internal
435 439
436 #endif // V8_SCOPES_H_ 440 #endif // V8_SCOPES_H_
OLDNEW
« no previous file with comments | « src/parser.cc ('k') | src/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698