Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(213)

Side by Side Diff: test/cctest/test-api.cc

Issue 1140333003: Introduce extras export object. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fixed comments Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/runtime/runtime-test.cc ('k') | test/cctest/test-extra.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 21083 matching lines...) Expand 10 before | Expand all | Expand 10 after
21094 CHECK(!try_catch.HasCaught()); 21094 CHECK(!try_catch.HasCaught());
21095 } 21095 }
21096 21096
21097 { 21097 {
21098 v8::TryCatch try_catch; 21098 v8::TryCatch try_catch;
21099 v8::Handle<Value> args[] = {v8_num(42), v8_num(555)}; 21099 v8::Handle<Value> args[] = {v8_num(42), v8_num(555)};
21100 fun->Call(v8::Undefined(isolate), arraysize(args), args); 21100 fun->Call(v8::Undefined(isolate), arraysize(args), args);
21101 CHECK(!try_catch.HasCaught()); 21101 CHECK(!try_catch.HasCaught());
21102 } 21102 }
21103 } 21103 }
21104
21105
21106 TEST(ExtrasExportsObject) {
21107 v8::Isolate* isolate = CcTest::isolate();
21108 v8::HandleScope handle_scope(isolate);
21109 LocalContext env;
21110
21111 // standalone.gypi ensures we include the test-extra.js file, which should
21112 // add the testExtraShouldReturnFive export
21113 v8::Local<v8::Object> exports = env->GetExtrasExportsObject();
21114
21115 auto func =
21116 exports->Get(v8_str("testExtraShouldReturnFive")).As<v8::Function>();
21117 auto undefined = v8::Undefined(isolate);
21118 auto result = func->Call(undefined, 0, {}).As<v8::Number>();
21119
21120 CHECK(result->Value() == 5.0);
21121 }
OLDNEW
« no previous file with comments | « src/runtime/runtime-test.cc ('k') | test/cctest/test-extra.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698