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

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

Issue 1128113006: Add the concept of a V8 extras exports object (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Was mising test-extra.js :( 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 21011 matching lines...) Expand 10 before | Expand all | Expand 10 after
21022 21022
21023 { 21023 {
21024 v8::HandleScope handle_scope(isolate); 21024 v8::HandleScope handle_scope(isolate);
21025 21025
21026 // Should work 21026 // Should work
21027 v8::Local<v8::Object> obj = v8::Object::New(isolate); 21027 v8::Local<v8::Object> obj = v8::Object::New(isolate);
21028 21028
21029 USE(obj); 21029 USE(obj);
21030 } 21030 }
21031 } 21031 }
21032
21033
21034 TEST(ExtrasExportsObject) {
21035 v8::Isolate* isolate = CcTest::isolate();
21036 v8::HandleScope handle_scope(isolate);
21037 LocalContext env;
21038
21039 // standalone.gypi ensures we include the test-extra.js file, which should
21040 // add the testExtraShouldReturnFive export
21041 v8::Local<v8::Object> exports = env->GetExtrasExportsObject();
21042
21043 auto func =
21044 exports->Get(v8_str("testExtraShouldReturnFive")).As<v8::Function>();
21045 auto undefined = v8::Undefined(isolate);
21046 auto result = func->Call(undefined, 0, {}).As<v8::Number>();
21047
21048 CHECK(result->Value() == 5.0);
21049 }
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