OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |