// Copyright 2017 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. #include "include/v8-context.h" #include "include/v8-isolate.h" #include "include/v8-local-handle.h" #include "include/v8-primitive.h" #include "include/v8-template.h" #include "src/objects/objects-inl.h" #include "test/unittests/test-utils.h" #include "testing/gtest/include/gtest/gtest.h" namespace v8 { namespace { using ScriptTest = TestWithContext; namespace { bool ValueEqualsString(v8::Isolate* isolate, Local lhs, const char* rhs) { CHECK(!lhs.IsEmpty()); CHECK(lhs->IsString()); String::Utf8Value utf8_lhs(isolate, lhs); return strcmp(rhs, *utf8_lhs) == 0; } } // namespace TEST_F(ScriptTest, UnboundScriptPosition) { const char* url = "http://www.foo.com/foo.js"; v8::ScriptOrigin origin(isolate(), NewString(url), 13, 0); v8::ScriptCompiler::Source script_source(NewString("var foo;"), origin); Local