Revision f230a1cf deps/v8/src/liveedit.cc

View differences:

deps/v8/src/liveedit.cc
731 731
    Handle<JSValue> scope_wrapper = WrapInJSValue(code_scope_info);
732 732
    this->SetField(kCodeScopeInfoOffset_, scope_wrapper);
733 733
  }
734
  void SetOuterScopeInfo(Handle<Object> scope_info_array) {
735
    this->SetField(kOuterScopeInfoOffset_, scope_info_array);
734
  void SetFunctionScopeInfo(Handle<Object> scope_info_array) {
735
    this->SetField(kFunctionScopeInfoOffset_, scope_info_array);
736 736
  }
737 737
  void SetSharedFunctionInfo(Handle<SharedFunctionInfo> info) {
738 738
    Handle<JSValue> info_holder = WrapInJSValue(info);
......
771 771
  static const int kParamNumOffset_ = 3;
772 772
  static const int kCodeOffset_ = 4;
773 773
  static const int kCodeScopeInfoOffset_ = 5;
774
  static const int kOuterScopeInfoOffset_ = 6;
774
  static const int kFunctionScopeInfoOffset_ = 6;
775 775
  static const int kParentIndexOffset_ = 7;
776 776
  static const int kSharedFunctionInfoOffset_ = 8;
777 777
  static const int kLiteralNumOffset_ = 9;
......
880 880

  
881 881
    Handle<Object> scope_info_list(SerializeFunctionScope(scope, zone),
882 882
                                   isolate());
883
    info.SetOuterScopeInfo(scope_info_list);
883
    info.SetFunctionScopeInfo(scope_info_list);
884 884
  }
885 885

  
886 886
  Handle<JSArray> GetResult() { return result_; }
......
897 897
    // Saves some description of scope. It stores name and indexes of
898 898
    // variables in the whole scope chain. Null-named slots delimit
899 899
    // scopes of this chain.
900
    Scope* outer_scope = scope->outer_scope();
901
    if (outer_scope == NULL) {
902
      return isolate()->heap()->undefined_value();
903
    }
904
    do {
905
      ZoneList<Variable*> stack_list(outer_scope->StackLocalCount(), zone);
906
      ZoneList<Variable*> context_list(outer_scope->ContextLocalCount(), zone);
907
      outer_scope->CollectStackAndContextLocals(&stack_list, &context_list);
900
    Scope* current_scope = scope;
901
    while (current_scope != NULL) {
902
      ZoneList<Variable*> stack_list(current_scope->StackLocalCount(), zone);
903
      ZoneList<Variable*> context_list(
904
          current_scope->ContextLocalCount(), zone);
905
      current_scope->CollectStackAndContextLocals(&stack_list, &context_list);
908 906
      context_list.Sort(&Variable::CompareIndex);
909 907

  
910 908
      for (int i = 0; i < context_list.length(); i++) {
......
924 922
                                         isolate()));
925 923
      scope_info_length++;
926 924

  
927
      outer_scope = outer_scope->outer_scope();
928
    } while (outer_scope != NULL);
925
      current_scope = current_scope->outer_scope();
926
    }
929 927

  
930 928
    return *scope_info_list;
931 929
  }

Also available in: Unified diff