Sha256: 7d0d2b8d983212d04a99ca84f0f7a1dba84f2fd989955cc3d6df2f964410f55c

Contents?: true

Size: 1.46 KB

Versions: 4

Compression:

Stored size: 1.46 KB

Contents

// Copyright 2011 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef V8_PARSING_REWRITER_H_
#define V8_PARSING_REWRITER_H_

namespace v8 {
namespace internal {

class AstValueFactory;
class DoExpression;
class ParseInfo;
class Parser;
class DeclarationScope;
class Scope;

class Rewriter {
 public:
  // Rewrite top-level code (ECMA 262 "programs") so as to conservatively
  // include an assignment of the value of the last statement in the code to
  // a compiler-generated temporary variable wherever needed.
  //
  // Assumes code has been parsed and scopes have been analyzed.  Mutates the
  // AST, so the AST should not continue to be used in the case of failure.
  static bool Rewrite(ParseInfo* info);

  // Rewrite a list of statements, using the same rules as a top-level program,
  // to ensure identical behaviour of completion result.  The temporary is added
  // to the closure scope of the do-expression, which matches the closure scope
  // of the outer scope (the do-expression itself runs in a block scope, not a
  // closure scope). This closure scope needs to be passed in since the
  // do-expression could have dropped its own block scope.
  static bool Rewrite(Parser* parser, DeclarationScope* closure_scope,
                      DoExpression* expr, AstValueFactory* factory);
};


}  // namespace internal
}  // namespace v8

#endif  // V8_PARSING_REWRITER_H_

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
node-compiler-0.9.1 vendor/node/deps/v8/src/parsing/rewriter.h
node-compiler-0.9.0 vendor/node-v7.2.1/deps/v8/src/parsing/rewriter.h
node-compiler-0.8.0 vendor/node-v7.2.0/deps/v8/src/parsing/rewriter.h
node-compiler-0.7.0 vendor/node-v7.1.0/deps/v8/src/parsing/rewriter.h