Revision: 19702
Author:   [email protected]
Date:     Fri Mar  7 08:43:54 2014 UTC
Log: Remove Script::SetData and the script_data parameter from Script::(Compile|New).

This feature makes it possible to associate data with a script and get it back
when the script is compiled or when an event is handled. It was historically
used by Chromium Dev Tools, but not any more. It is not used by node.js.

Note: this has nothing to do with the preparse data, despite the confusing name.
The preparse data is passed as ScriptData*.

Note 2: This is the same as r19616 ( https://codereview.chromium.org/184403002/ )
with a unused variable fix in bootstrapper.cc.

[email protected]
BUG=

Review URL: https://codereview.chromium.org/185533014
http://code.google.com/p/v8/source/detail?r=19702

Modified:
 /branches/bleeding_edge/include/v8.h
 /branches/bleeding_edge/src/accessors.cc
 /branches/bleeding_edge/src/accessors.h
 /branches/bleeding_edge/src/api.cc
 /branches/bleeding_edge/src/bootstrapper.cc
 /branches/bleeding_edge/src/compiler.cc
 /branches/bleeding_edge/src/compiler.h
 /branches/bleeding_edge/src/debug.cc
 /branches/bleeding_edge/src/factory.cc
 /branches/bleeding_edge/src/heap-snapshot-generator.cc
 /branches/bleeding_edge/src/liveedit.cc
 /branches/bleeding_edge/src/objects-debug.cc
 /branches/bleeding_edge/src/objects-inl.h
 /branches/bleeding_edge/src/objects-printer.cc
 /branches/bleeding_edge/src/objects.h
 /branches/bleeding_edge/test/cctest/test-api.cc
 /branches/bleeding_edge/test/cctest/test-compiler.cc
 /branches/bleeding_edge/test/cctest/test-debug.cc
 /branches/bleeding_edge/test/cctest/test-parsing.cc

=======================================
--- /branches/bleeding_edge/include/v8.h        Tue Mar  4 12:43:05 2014 UTC
+++ /branches/bleeding_edge/include/v8.h        Fri Mar  7 08:43:54 2014 UTC
@@ -1011,16 +1011,12 @@
* \param pre_data Pre-parsing data, as obtained by ScriptData::PreCompile()
    *   using pre_data speeds compilation if it's done multiple times.
    *   Owned by caller, no references are kept when New() returns.
-   * \param script_data Arbitrary data associated with script. Using
-   *   this has same effect as calling SetData(), but allows data to be
-   *   available to compile event handlers.
    * \return Compiled script object (context independent; when run it
    *   will use the currently entered context).
    */
   static Local<Script> New(Handle<String> source,
                            ScriptOrigin* origin = NULL,
-                           ScriptData* pre_data = NULL,
-                           Handle<String> script_data = Handle<String>());
+                           ScriptData* pre_data = NULL);

   /**
    * Compiles the specified script using the specified file name
@@ -1044,17 +1040,13 @@
* \param pre_data Pre-parsing data, as obtained by ScriptData::PreCompile()
    *   using pre_data speeds compilation if it's done multiple times.
    *   Owned by caller, no references are kept when Compile() returns.
-   * \param script_data Arbitrary data associated with script. Using
-   *   this has same effect as calling SetData(), but makes data available
-   *   earlier (i.e. to compile event handlers).
    * \return Compiled script object, bound to the context that was active
    *   when this function was called.  When run it will always use this
    *   context.
    */
   static Local<Script> Compile(Handle<String> source,
                                ScriptOrigin* origin = NULL,
-                               ScriptData* pre_data = NULL,
- Handle<String> script_data = Handle<String>());
+                               ScriptData* pre_data = NULL);

   /**
    * Compiles the specified script using the specified file name
@@ -1062,16 +1054,12 @@
    *
    * \param source Script source code.
    * \param file_name File name to use as script's origin
-   * \param script_data Arbitrary data associated with script. Using
-   *   this has same effect as calling SetData(), but makes data available
-   *   earlier (i.e. to compile event handlers).
    * \return Compiled script object, bound to the context that was active
    *   when this function was called.  When run it will always use this
    *   context.
    */
   static Local<Script> Compile(Handle<String> source,
-                               Handle<Value> file_name,
- Handle<String> script_data = Handle<String>());
+                               Handle<Value> file_name);

   /**
    * Runs the script returning the resulting value.  If the script is
@@ -1087,13 +1075,6 @@
    */
   int GetId();

-  /**
- * Associate an additional data object with the script. This is mainly used
-   * with the debugger as this data object is only available through the
-   * debugger API.
-   */
-  void SetData(Handle<String> data);
-
   /**
    * Returns the name value of one Script.
    */
=======================================
--- /branches/bleeding_edge/src/accessors.cc    Fri Feb 28 14:09:52 2014 UTC
+++ /branches/bleeding_edge/src/accessors.cc    Fri Mar  7 08:43:54 2014 UTC
@@ -350,26 +350,6 @@
 };


-//
-// Accessors::ScriptData
-//
-
-
-MaybeObject* Accessors::ScriptGetData(Isolate* isolate,
-                                      Object* object,
-                                      void*) {
-  Object* script = JSValue::cast(object)->value();
-  return Script::cast(script)->data();
-}
-
-
-const AccessorDescriptor Accessors::ScriptData = {
-  ScriptGetData,
-  IllegalSetter,
-  0
-};
-
-
 //
 // Accessors::ScriptType
 //
=======================================
--- /branches/bleeding_edge/src/accessors.h     Fri Feb 28 14:09:52 2014 UTC
+++ /branches/bleeding_edge/src/accessors.h     Fri Mar  7 08:43:54 2014 UTC
@@ -49,7 +49,6 @@
   V(ScriptId)                       \
   V(ScriptLineOffset)               \
   V(ScriptColumnOffset)             \
-  V(ScriptData)                     \
   V(ScriptType)                     \
   V(ScriptCompilationType)          \
   V(ScriptLineEnds)                 \
@@ -128,7 +127,6 @@
   static MaybeObject* ScriptGetColumnOffset(Isolate* isolate,
                                             Object* object,
                                             void*);
- static MaybeObject* ScriptGetData(Isolate* isolate, Object* object, void*); static MaybeObject* ScriptGetType(Isolate* isolate, Object* object, void*);
   static MaybeObject* ScriptGetCompilationType(Isolate* isolate,
                                                Object* object,
=======================================
--- /branches/bleeding_edge/src/api.cc  Fri Feb 28 14:09:52 2014 UTC
+++ /branches/bleeding_edge/src/api.cc  Fri Mar  7 08:43:54 2014 UTC
@@ -1616,8 +1616,7 @@

 Local<Script> Script::New(v8::Handle<String> source,
                           v8::ScriptOrigin* origin,
-                          v8::ScriptData* pre_data,
-                          v8::Handle<String> script_data) {
+                          v8::ScriptData* pre_data) {
   i::Handle<i::String> str = Utils::OpenHandle(*source);
   i::Isolate* isolate = str->GetIsolate();
   ON_BAILOUT(isolate, "v8::Script::New()", return Local<Script>());
@@ -1665,7 +1664,6 @@
                                    isolate->global_context(),
                                    NULL,
                                    pre_data_impl,
-                                   Utils::OpenHandle(*script_data, true),
                                    i::NOT_NATIVES_CODE);
     has_pending_exception = result.is_null();
     EXCEPTION_BAILOUT_CHECK(isolate, Local<Script>());
@@ -1685,14 +1683,13 @@

 Local<Script> Script::Compile(v8::Handle<String> source,
                               v8::ScriptOrigin* origin,
-                              v8::ScriptData* pre_data,
-                              v8::Handle<String> script_data) {
+                              v8::ScriptData* pre_data) {
   i::Handle<i::String> str = Utils::OpenHandle(*source);
   i::Isolate* isolate = str->GetIsolate();
   ON_BAILOUT(isolate, "v8::Script::Compile()", return Local<Script>());
   LOG_API(isolate, "Script::Compile");
   ENTER_V8(isolate);
-  Local<Script> generic = New(source, origin, pre_data, script_data);
+  Local<Script> generic = New(source, origin, pre_data);
   if (generic.IsEmpty())
     return generic;
   i::Handle<i::Object> obj = Utils::OpenHandle(*generic);
@@ -1707,10 +1704,9 @@


 Local<Script> Script::Compile(v8::Handle<String> source,
-                              v8::Handle<Value> file_name,
-                              v8::Handle<String> script_data) {
+                              v8::Handle<Value> file_name) {
   ScriptOrigin origin(file_name);
-  return Compile(source, &origin, 0, script_data);
+  return Compile(source, &origin);
 }


@@ -1807,22 +1803,6 @@
     return Handle<String>();
   }
 }
-
-
-void Script::SetData(v8::Handle<String> data) {
-  i::Handle<i::HeapObject> obj =
-      i::Handle<i::HeapObject>::cast(Utils::OpenHandle(this));
-  i::Isolate* isolate = obj->GetIsolate();
-  ON_BAILOUT(isolate, "v8::Script::SetData()", return);
-  LOG_API(isolate, "Script::SetData");
-  {
-    i::HandleScope scope(isolate);
-    i::Handle<i::SharedFunctionInfo> function_info = OpenScript(this);
-    i::Handle<i::Object> raw_data = Utils::OpenHandle(*data);
-    i::Handle<i::Script> script(i::Script::cast(function_info->script()));
-    script->set_data(*raw_data);
-  }
-}


 // --- E x c e p t i o n s ---
@@ -1978,21 +1958,6 @@
                                      isolate);
   return scope.Escape(Utils::ToLocal(resource_name));
 }
-
-
-v8::Handle<Value> Message::GetScriptData() const {
-  i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
-  ENTER_V8(isolate);
-  EscapableHandleScope scope(reinterpret_cast<Isolate*>(isolate));
-  i::Handle<i::JSMessageObject> message =
-      i::Handle<i::JSMessageObject>::cast(Utils::OpenHandle(this));
-  // Return this.script.data.
-  i::Handle<i::JSValue> script =
-      i::Handle<i::JSValue>::cast(i::Handle<i::Object>(message->script(),
-                                                       isolate));
- i::Handle<i::Object> data(i::Script::cast(script->value())->data(), isolate);
-  return scope.Escape(Utils::ToLocal(data));
-}


 v8::Handle<v8::StackTrace> Message::GetStackTrace() const {
=======================================
--- /branches/bleeding_edge/src/bootstrapper.cc Fri Feb 28 14:09:52 2014 UTC
+++ /branches/bleeding_edge/src/bootstrapper.cc Fri Mar  7 08:43:54 2014 UTC
@@ -1520,7 +1520,6 @@
         top_context,
         extension,
         NULL,
-        Handle<String>::null(),
         use_runtime_context ? NATIVES_CODE : NOT_NATIVES_CODE);
     if (function_info.is_null()) return false;
     if (cache != NULL) cache->Add(name, function_info);
@@ -1755,9 +1754,6 @@
             STATIC_ASCII_VECTOR("column_offset")));
     Handle<Foreign> script_column_offset(
         factory()->NewForeign(&Accessors::ScriptColumnOffset));
-    Handle<String> data_string(factory()->InternalizeOneByteString(
-        STATIC_ASCII_VECTOR("data")));
- Handle<Foreign> script_data(factory()->NewForeign(&Accessors::ScriptData));
     Handle<String> type_string(factory()->InternalizeOneByteString(
         STATIC_ASCII_VECTOR("type")));
Handle<Foreign> script_type(factory()->NewForeign(&Accessors::ScriptType));
@@ -1820,11 +1816,6 @@
           *column_offset_string, *script_column_offset, attribs);
       script_map->AppendDescriptor(&d, witness);
     }
-
-    {
-      CallbacksDescriptor d(*data_string, *script_data, attribs);
-      script_map->AppendDescriptor(&d, witness);
-    }

     {
       CallbacksDescriptor d(*type_string, *script_type, attribs);
=======================================
--- /branches/bleeding_edge/src/compiler.cc     Mon Mar  3 11:11:39 2014 UTC
+++ /branches/bleeding_edge/src/compiler.cc     Fri Mar  7 08:43:54 2014 UTC
@@ -927,7 +927,6 @@
                                                    Handle<Context> context,
v8::Extension* extension, ScriptDataImpl* pre_data, - Handle<Object> script_data,
                                                    NativesFlag natives) {
   Isolate* isolate = source->GetIsolate();
   int source_length = source->length();
@@ -969,9 +968,6 @@
     }
     script->set_is_shared_cross_origin(is_shared_cross_origin);

- script->set_data(script_data.is_null() ? isolate->heap()->undefined_value()
-                                           : *script_data);
-
     // Compile the function and add it to the cache.
     CompilationInfoWithZone info(script);
     info.MarkAsGlobal();
=======================================
--- /branches/bleeding_edge/src/compiler.h      Fri Feb 28 14:09:52 2014 UTC
+++ /branches/bleeding_edge/src/compiler.h      Fri Mar  7 08:43:54 2014 UTC
@@ -631,7 +631,6 @@
                                                   Handle<Context> context,
                                                   v8::Extension* extension,
                                                   ScriptDataImpl* pre_data,
- Handle<Object> script_data, NativesFlag is_natives_code);

// Create a shared function info object (the code may be lazily compiled).
=======================================
--- /branches/bleeding_edge/src/debug.cc        Fri Feb 28 14:09:52 2014 UTC
+++ /branches/bleeding_edge/src/debug.cc        Fri Mar  7 08:43:54 2014 UTC
@@ -763,7 +763,6 @@
                                           false,
                                           context,
                                           NULL, NULL,
-                                          Handle<String>::null(),
                                           NATIVES_CODE);

   // Silently ignore stack overflows during compilation.
=======================================
--- /branches/bleeding_edge/src/factory.cc      Mon Mar  3 11:11:39 2014 UTC
+++ /branches/bleeding_edge/src/factory.cc      Fri Mar  7 08:43:54 2014 UTC
@@ -700,7 +700,6 @@
   script->set_id(Smi::FromInt(id));
   script->set_line_offset(Smi::FromInt(0));
   script->set_column_offset(Smi::FromInt(0));
-  script->set_data(heap->undefined_value());
   script->set_context_data(heap->undefined_value());
   script->set_type(Smi::FromInt(Script::TYPE_NORMAL));
   script->set_wrapper(*wrapper);
=======================================
--- /branches/bleeding_edge/src/heap-snapshot-generator.cc Fri Feb 28 14:09:52 2014 UTC +++ /branches/bleeding_edge/src/heap-snapshot-generator.cc Fri Mar 7 08:43:54 2014 UTC
@@ -1341,9 +1341,6 @@
   SetInternalReference(obj, entry,
                        "name", script->name(),
                        Script::kNameOffset);
-  SetInternalReference(obj, entry,
-                       "data", script->data(),
-                       Script::kDataOffset);
   SetInternalReference(obj, entry,
                        "context_data", script->context_data(),
                        Script::kContextOffset);
=======================================
--- /branches/bleeding_edge/src/liveedit.cc     Fri Feb 28 14:09:52 2014 UTC
+++ /branches/bleeding_edge/src/liveedit.cc     Fri Mar  7 08:43:54 2014 UTC
@@ -1557,7 +1557,6 @@
   copy->set_name(original->name());
   copy->set_line_offset(original->line_offset());
   copy->set_column_offset(original->column_offset());
-  copy->set_data(original->data());
   copy->set_type(original->type());
   copy->set_context_data(original->context_data());
   copy->set_eval_from_shared(original->eval_from_shared());
=======================================
--- /branches/bleeding_edge/src/objects-debug.cc Fri Feb 28 14:09:52 2014 UTC +++ /branches/bleeding_edge/src/objects-debug.cc Fri Mar 7 08:43:54 2014 UTC
@@ -931,7 +931,6 @@
   VerifyPointer(name());
   line_offset()->SmiVerify();
   column_offset()->SmiVerify();
-  VerifyPointer(data());
   VerifyPointer(wrapper());
   type()->SmiVerify();
   VerifyPointer(line_ends());
=======================================
--- /branches/bleeding_edge/src/objects-inl.h   Tue Mar  4 12:48:17 2014 UTC
+++ /branches/bleeding_edge/src/objects-inl.h   Fri Mar  7 08:43:54 2014 UTC
@@ -4901,7 +4901,6 @@
 ACCESSORS(Script, id, Smi, kIdOffset)
 ACCESSORS_TO_SMI(Script, line_offset, kLineOffsetOffset)
 ACCESSORS_TO_SMI(Script, column_offset, kColumnOffsetOffset)
-ACCESSORS(Script, data, Object, kDataOffset)
 ACCESSORS(Script, context_data, Object, kContextOffset)
 ACCESSORS(Script, wrapper, Foreign, kWrapperOffset)
 ACCESSORS_TO_SMI(Script, type, kTypeOffset)
=======================================
--- /branches/bleeding_edge/src/objects-printer.cc Fri Feb 28 14:09:52 2014 UTC +++ /branches/bleeding_edge/src/objects-printer.cc Fri Mar 7 08:43:54 2014 UTC
@@ -1147,8 +1147,6 @@
   type()->ShortPrint(out);
   PrintF(out, "\n - id: ");
   id()->ShortPrint(out);
-  PrintF(out, "\n - data: ");
-  data()->ShortPrint(out);
   PrintF(out, "\n - context data: ");
   context_data()->ShortPrint(out);
   PrintF(out, "\n - wrapper: ");
=======================================
--- /branches/bleeding_edge/src/objects.h       Thu Mar  6 13:07:51 2014 UTC
+++ /branches/bleeding_edge/src/objects.h       Fri Mar  7 08:43:54 2014 UTC
@@ -6517,9 +6517,6 @@
   // extracted.
   DECL_ACCESSORS(column_offset, Smi)

-  // [data]: additional data associated with this script.
-  DECL_ACCESSORS(data, Object)
-
// [context_data]: context data for the context this script was compiled in.
   DECL_ACCESSORS(context_data, Object)

@@ -6573,8 +6570,7 @@
   static const int kNameOffset = kSourceOffset + kPointerSize;
   static const int kLineOffsetOffset = kNameOffset + kPointerSize;
   static const int kColumnOffsetOffset = kLineOffsetOffset + kPointerSize;
-  static const int kDataOffset = kColumnOffsetOffset + kPointerSize;
-  static const int kContextOffset = kDataOffset + kPointerSize;
+  static const int kContextOffset = kColumnOffsetOffset + kPointerSize;
   static const int kWrapperOffset = kContextOffset + kPointerSize;
   static const int kTypeOffset = kWrapperOffset + kPointerSize;
   static const int kLineEndsOffset = kTypeOffset + kPointerSize;
=======================================
--- /branches/bleeding_edge/test/cctest/test-api.cc Wed Mar 5 10:07:07 2014 UTC +++ /branches/bleeding_edge/test/cctest/test-api.cc Fri Mar 7 08:43:54 2014 UTC
@@ -3974,7 +3974,6 @@
                             v8::Handle<Value> data) {
   CHECK_EQ(5.76, data->NumberValue());
   CHECK_EQ(6.75, message->GetScriptResourceName()->NumberValue());
-  CHECK_EQ(7.56, message->GetScriptData()->NumberValue());
   CHECK(!message->IsSharedCrossOrigin());
   message_received = true;
 }
@@ -3990,7 +3989,6 @@
       v8::ScriptOrigin(v8_str("6.75"));
   v8::Handle<v8::Script> script = Script::Compile(v8_str("throw 'error'"),
                                                   &origin);
-  script->SetData(v8_str("7.56"));
   script->Run();
   CHECK(message_received);
   // clear out the message listener
=======================================
--- /branches/bleeding_edge/test/cctest/test-compiler.cc Fri Feb 28 14:09:52 2014 UTC +++ /branches/bleeding_edge/test/cctest/test-compiler.cc Fri Mar 7 08:43:54 2014 UTC
@@ -67,7 +67,6 @@
                               false,
                               Handle<Context>(isolate->native_context()),
                               NULL, NULL,
-                              Handle<String>::null(),
                               NOT_NATIVES_CODE);
   return isolate->factory()->NewFunctionFromSharedFunctionInfo(
       shared_function, isolate->native_context());
=======================================
--- /branches/bleeding_edge/test/cctest/test-debug.cc Fri Feb 28 14:09:52 2014 UTC +++ /branches/bleeding_edge/test/cctest/test-debug.cc Fri Mar 7 08:43:54 2014 UTC
@@ -581,24 +581,6 @@
 v8::Local<v8::Function> frame_script_name;


-// Source for the JavaScript function which picks out the script data for the
-// top frame.
-const char* frame_script_data_source =
-    "function frame_script_data(exec_state) {"
-    "  return exec_state.frame(0).func().script().data();"
-    "}";
-v8::Local<v8::Function> frame_script_data;
-
-
-// Source for the JavaScript function which picks out the script data from
-// AfterCompile event
-const char* compiled_script_data_source =
-    "function compiled_script_data(event_data) {"
-    "  return event_data.script().data();"
-    "}";
-v8::Local<v8::Function> compiled_script_data;
-
-
 // Source for the JavaScript function which returns the number of frames.
 static const char* frame_count_source =
     "function frame_count(exec_state) {"
@@ -610,10 +592,8 @@
 // Global variable to store the last function hit - used by some tests.
 char last_function_hit[80];

-// Global variable to store the name and data for last script hit - used by some
-// tests.
+// Global variable to store the name for last script hit - used by some tests.
 char last_script_name_hit[80];
-char last_script_data_hit[80];

 // Global variables to store the last source position - used by some tests.
 int last_source_line = -1;
@@ -626,7 +606,6 @@
     const v8::Debug::EventDetails& event_details) {
   v8::DebugEvent event = event_details.GetEvent();
   v8::Handle<v8::Object> exec_state = event_details.GetExecutionState();
-  v8::Handle<v8::Object> event_data = event_details.GetEventData();
   v8::internal::Isolate* isolate = CcTest::i_isolate();
   Debug* debug = isolate->debug();
   // When hitting a debug event listener there must be a break set.
@@ -686,41 +665,12 @@
         script_name->WriteUtf8(last_script_name_hit);
       }
     }
-
-    if (!frame_script_data.IsEmpty()) {
-      // Get the script data of the function script.
-      const int argc = 1;
-      v8::Handle<v8::Value> argv[argc] = { exec_state };
-      v8::Handle<v8::Value> result = frame_script_data->Call(exec_state,
-                                                             argc, argv);
-      if (result->IsUndefined()) {
-        last_script_data_hit[0] = '\0';
-      } else {
-        result = result->ToString();
-        CHECK(result->IsString());
-        v8::Handle<v8::String> script_data(result->ToString());
-        script_data->WriteUtf8(last_script_data_hit);
-      }
-    }

     // Perform a full deoptimization when the specified number of
     // breaks have been hit.
     if (break_point_hit_count == break_point_hit_count_deoptimize) {
       i::Deoptimizer::DeoptimizeAll(isolate);
     }
- } else if (event == v8::AfterCompile && !compiled_script_data.IsEmpty()) {
-    const int argc = 1;
-    v8::Handle<v8::Value> argv[argc] = { event_data };
-    v8::Handle<v8::Value> result = compiled_script_data->Call(exec_state,
-                                                              argc, argv);
-    if (result->IsUndefined()) {
-      last_script_data_hit[0] = '\0';
-    } else {
-      result = result->ToString();
-      CHECK(result->IsString());
-      v8::Handle<v8::String> script_data(result->ToString());
-      script_data->WriteUtf8(last_script_data_hit);
-    }
   }
 }

@@ -6249,12 +6199,6 @@
   frame_script_name = CompileFunction(&env,
                                       frame_script_name_source,
                                       "frame_script_name");
-  frame_script_data = CompileFunction(&env,
-                                      frame_script_data_source,
-                                      "frame_script_data");
-  compiled_script_data = CompileFunction(&env,
-                                         compiled_script_data_source,
-                                         "compiled_script_data");

   v8::Debug::SetDebugEventListener2(DebugEventBreakPointHitCount);

@@ -6267,7 +6211,6 @@
   v8::ScriptOrigin origin1 =
       v8::ScriptOrigin(v8::String::NewFromUtf8(env->GetIsolate(), "name"));
   v8::Handle<v8::Script> script1 = v8::Script::Compile(script, &origin1);
-  script1->SetData(v8::String::NewFromUtf8(env->GetIsolate(), "data"));
   script1->Run();
   v8::Local<v8::Function> f;
   f = v8::Local<v8::Function>::Cast(
@@ -6276,7 +6219,6 @@
   f->Call(env->Global(), 0, NULL);
   CHECK_EQ(1, break_point_hit_count);
   CHECK_EQ("name", last_script_name_hit);
-  CHECK_EQ("data", last_script_data_hit);

   // Compile the same script again without setting data. As the compilation
   // cache is disabled when debugging expect the data to be missing.
@@ -6286,7 +6228,6 @@
   f->Call(env->Global(), 0, NULL);
   CHECK_EQ(2, break_point_hit_count);
   CHECK_EQ("name", last_script_name_hit);
- CHECK_EQ("", last_script_data_hit); // Undefined results in empty string.

   v8::Local<v8::String> data_obj_source = v8::String::NewFromUtf8(
       env->GetIsolate(),
@@ -6294,29 +6235,24 @@
       "  b: 123,\n"
       "  toString: function() { return this.a + ' ' + this.b; }\n"
       "})\n");
- v8::Local<v8::Value> data_obj = v8::Script::Compile(data_obj_source)->Run();
+  v8::Script::Compile(data_obj_source)->Run();
   v8::ScriptOrigin origin2 =
v8::ScriptOrigin(v8::String::NewFromUtf8(env->GetIsolate(), "new name"));
   v8::Handle<v8::Script> script2 = v8::Script::Compile(script, &origin2);
   script2->Run();
-  script2->SetData(data_obj->ToString());
   f = v8::Local<v8::Function>::Cast(
       env->Global()->Get(v8::String::NewFromUtf8(env->GetIsolate(), "f")));
   f->Call(env->Global(), 0, NULL);
   CHECK_EQ(3, break_point_hit_count);
   CHECK_EQ("new name", last_script_name_hit);
-  CHECK_EQ("abc 123", last_script_data_hit);

   v8::Handle<v8::Script> script3 = v8::Script::Compile(
-      script, &origin2, NULL,
-      v8::String::NewFromUtf8(env->GetIsolate(), "in compile"));
-  CHECK_EQ("in compile", last_script_data_hit);
+      script, &origin2, NULL);
   script3->Run();
   f = v8::Local<v8::Function>::Cast(
       env->Global()->Get(v8::String::NewFromUtf8(env->GetIsolate(), "f")));
   f->Call(env->Global(), 0, NULL);
   CHECK_EQ(4, break_point_hit_count);
-  CHECK_EQ("in compile", last_script_data_hit);
 }


=======================================
--- /branches/bleeding_edge/test/cctest/test-parsing.cc Fri Feb 28 14:09:52 2014 UTC +++ /branches/bleeding_edge/test/cctest/test-parsing.cc Fri Mar 7 08:43:54 2014 UTC
@@ -223,7 +223,7 @@
     ScriptResource* resource = new ScriptResource(source, source_length);
     v8::Local<v8::String> script_source =
         v8::String::NewExternal(isolate, resource);
- v8::Script::New(script_source, NULL, preparse, v8::Local<v8::String>());
+    v8::Script::New(script_source, NULL, preparse);
   }
   delete preparse;
   i::FLAG_lazy = lazy_flag;

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to