Revision f230a1cf deps/v8/samples/lineprocessor.cc

View differences:

deps/v8/samples/lineprocessor.cc
259 259

  
260 260
  if (cycle_type == CycleInCpp) {
261 261
    bool res = RunCppCycle(script,
262
                           v8::Context::GetCurrent(),
262
                           isolate->GetCurrentContext(),
263 263
                           report_exceptions);
264 264
    return !res;
265 265
  } else {
......
296 296
    v8::HandleScope handle_scope(isolate);
297 297

  
298 298
    v8::Handle<v8::String> input_line = ReadLine();
299
    if (input_line == v8::Undefined()) {
299
    if (input_line == v8::Undefined(isolate)) {
300 300
      continue;
301 301
    }
302 302

  
......
306 306
    v8::Handle<v8::Value> result;
307 307
    {
308 308
      v8::TryCatch try_catch;
309
      result = process_fun->Call(v8::Context::GetCurrent()->Global(),
309
      result = process_fun->Call(isolate->GetCurrentContext()->Global(),
310 310
                                 argc, argv);
311 311
      if (try_catch.HasCaught()) {
312 312
        if (report_exceptions)
......
417 417
// function is called. Reads a string from standard input and returns.
418 418
void ReadLine(const v8::FunctionCallbackInfo<v8::Value>& args) {
419 419
  if (args.Length() > 0) {
420
    v8::ThrowException(v8::String::New("Unexpected arguments"));
420
    args.GetIsolate()->ThrowException(v8::String::New("Unexpected arguments"));
421 421
    return;
422 422
  }
423 423
  args.GetReturnValue().Set(ReadLine());
......
436 436
    res = fgets(buffer, kBufferSize, stdin);
437 437
  }
438 438
  if (res == NULL) {
439
    v8::Handle<v8::Primitive> t = v8::Undefined();
439
    v8::Handle<v8::Primitive> t = v8::Undefined(v8::Isolate::GetCurrent());
440 440
    return v8::Handle<v8::String>::Cast(t);
441 441
  }
442 442
  // Remove newline char

Also available in: Unified diff