Lines Matching refs:v8
1 // Copyright 2011 the V8 project authors. All rights reserved.
10 #include "v8.h"
29 using namespace v8::internal;
31 static v8::Persistent<v8::Context> env;
36 v8::HandleScope scope;
37 const char* extensions[] = { "v8/print" };
38 v8::ExtensionConfiguration config(1, extensions);
39 env = v8::Context::New(&config);
41 v8::HandleScope scope;
51 class Resource: public v8::String::ExternalStringResource,
66 class AsciiResource: public v8::String::ExternalAsciiStringResource,
234 v8::HandleScope scope;
282 v8::HandleScope scope;
307 v8::HandleScope handle_scope;
311 v8::String::New(ascii_string,
327 v8::Handle<v8::String> mixed = v8::String::New(mixed_string, 5);
354 v8::HandleScope handle_scope;
361 v8::Handle<v8::Array> ascii_external_strings =
362 v8::Array::New(kMaxLength + 1);
363 v8::Handle<v8::Array> non_ascii_external_strings =
364 v8::Array::New(kMaxLength + 1);
376 v8::Local<v8::String> ascii_external_string =
377 v8::String::NewExternal(ascii_resource);
379 ascii_external_strings->Set(v8::Integer::New(i), ascii_external_string);
387 v8::Local<v8::String> non_ascii_external_string =
388 v8::String::NewExternal(resource);
389 non_ascii_external_strings->Set(v8::Integer::New(i),
394 v8::Handle<v8::Object> global = env->Global();
397 global->Set(v8_str("max_length"), v8::Integer::New(kMaxLength));
440 // See http://code.google.com/p/v8/issues/detail?id=728
444 v8::HandleScope handle_scope;
473 v8::Local<v8::Value> result =
474 v8::Script::Compile(v8::String::New(line))->Run();
488 v8::HandleScope scope;
505 class AsciiVectorResource : public v8::String::ExternalAsciiStringResource {
520 v8::HandleScope scope;
540 v8::Local<v8::Value> result;
550 string = v8::Utils::OpenHandle(v8::String::Cast(*result));
557 string = v8::Utils::OpenHandle(v8::String::Cast(*result));
569 v8::Local<v8::Value> result;
578 string = v8::Utils::OpenHandle(v8::String::Cast(*result));
585 string = v8::Utils::OpenHandle(v8::String::Cast(*result));