OLD | NEW |
1 // Copyright 2007-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2009 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 5031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5042 } | 5042 } |
5043 | 5043 |
5044 | 5044 |
5045 THREADED_TEST(GetOwnPropertyNamesWithInterceptor) { | 5045 THREADED_TEST(GetOwnPropertyNamesWithInterceptor) { |
5046 v8::HandleScope handle_scope; | 5046 v8::HandleScope handle_scope; |
5047 v8::Handle<v8::ObjectTemplate> obj_template = v8::ObjectTemplate::New(); | 5047 v8::Handle<v8::ObjectTemplate> obj_template = v8::ObjectTemplate::New(); |
5048 | 5048 |
5049 obj_template->Set(v8_str("x"), v8::Integer::New(42)); | 5049 obj_template->Set(v8_str("x"), v8::Integer::New(42)); |
5050 obj_template->SetNamedPropertyHandler(NULL, NULL, NULL, NULL, | 5050 obj_template->SetNamedPropertyHandler(NULL, NULL, NULL, NULL, |
5051 NamedPropertyEnumerator); | 5051 NamedPropertyEnumerator); |
5052 | 5052 |
5053 LocalContext context; | 5053 LocalContext context; |
5054 v8::Handle<v8::Object> global = context->Global(); | 5054 v8::Handle<v8::Object> global = context->Global(); |
5055 global->Set(v8_str("object"), obj_template->NewInstance()); | 5055 global->Set(v8_str("object"), obj_template->NewInstance()); |
5056 | 5056 |
5057 v8::Handle<Value> value = | 5057 v8::Handle<Value> value = |
5058 CompileRun("Object.getOwnPropertyNames(object).join(',')"); | 5058 CompileRun("Object.getOwnPropertyNames(object).join(',')"); |
5059 CHECK_EQ(v8_str("x"), value); | 5059 CHECK_EQ(v8_str("x"), value); |
5060 } | 5060 } |
5061 | 5061 |
5062 | 5062 |
(...skipping 5884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10947 const char* code = | 10947 const char* code = |
10948 "(function() {" | 10948 "(function() {" |
10949 " for (var i = 0; i < 2*16; i++) {" | 10949 " for (var i = 0; i < 2*16; i++) {" |
10950 " %_GetFromCache(0, 'a' + i);" | 10950 " %_GetFromCache(0, 'a' + i);" |
10951 " };" | 10951 " };" |
10952 " return 'PASSED';" | 10952 " return 'PASSED';" |
10953 "})()"; | 10953 "})()"; |
10954 v8::internal::Heap::ClearJSFunctionResultCaches(); | 10954 v8::internal::Heap::ClearJSFunctionResultCaches(); |
10955 ExpectString(code, "PASSED"); | 10955 ExpectString(code, "PASSED"); |
10956 } | 10956 } |
OLD | NEW |