| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "test/cctest/cctest.h" | 5 #include "test/cctest/cctest.h" |
| 6 | 6 |
| 7 #include "include/v8-experimental.h" | 7 #include "include/v8-experimental.h" |
| 8 #include "include/v8.h" | 8 #include "include/v8.h" |
| 9 #include "src/api.h" | 9 #include "src/api.h" |
| 10 #include "src/objects-inl.h" |
| 10 | 11 |
| 11 namespace i = v8::internal; | 12 namespace i = v8::internal; |
| 12 | 13 |
| 13 static void CppAccessor42(const v8::FunctionCallbackInfo<v8::Value>& info) { | 14 static void CppAccessor42(const v8::FunctionCallbackInfo<v8::Value>& info) { |
| 14 info.GetReturnValue().Set(42); | 15 info.GetReturnValue().Set(42); |
| 15 } | 16 } |
| 16 | 17 |
| 17 | 18 |
| 18 static void CppAccessor41(const v8::FunctionCallbackInfo<v8::Value>& info) { | 19 static void CppAccessor41(const v8::FunctionCallbackInfo<v8::Value>& info) { |
| 19 info.GetReturnValue().Set(41); | 20 info.GetReturnValue().Set(41); |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 v8::Local<v8::Context> ctx = | 271 v8::Local<v8::Context> ctx = |
| 271 v8::Context::New(CcTest::isolate(), nullptr, object_template); | 272 v8::Context::New(CcTest::isolate(), nullptr, object_template); |
| 272 | 273 |
| 273 // Declare function. | 274 // Declare function. |
| 274 v8::Local<v8::String> code = v8_str("function foo() {};"); | 275 v8::Local<v8::String> code = v8_str("function foo() {};"); |
| 275 | 276 |
| 276 v8::TryCatch try_catch(CcTest::isolate()); | 277 v8::TryCatch try_catch(CcTest::isolate()); |
| 277 v8::Script::Compile(ctx, code).ToLocalChecked()->Run(ctx).IsEmpty(); | 278 v8::Script::Compile(ctx, code).ToLocalChecked()->Run(ctx).IsEmpty(); |
| 278 CHECK(try_catch.HasCaught()); | 279 CHECK(try_catch.HasCaught()); |
| 279 } | 280 } |
| OLD | NEW |