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 20266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
20277 TEST(PersistentHandleVisitor) { | 20277 TEST(PersistentHandleVisitor) { |
20278 LocalContext context; | 20278 LocalContext context; |
20279 v8::Isolate* isolate = context->GetIsolate(); | 20279 v8::Isolate* isolate = context->GetIsolate(); |
20280 v8::HandleScope scope(isolate); | 20280 v8::HandleScope scope(isolate); |
20281 v8::Persistent<v8::Object> object(isolate, v8::Object::New(isolate)); | 20281 v8::Persistent<v8::Object> object(isolate, v8::Object::New(isolate)); |
20282 CHECK_EQ(0, object.WrapperClassId()); | 20282 CHECK_EQ(0, object.WrapperClassId()); |
20283 object.SetWrapperClassId(42); | 20283 object.SetWrapperClassId(42); |
20284 CHECK_EQ(42, object.WrapperClassId()); | 20284 CHECK_EQ(42, object.WrapperClassId()); |
20285 | 20285 |
20286 Visitor42 visitor(&object); | 20286 Visitor42 visitor(&object); |
20287 v8::V8::VisitHandlesWithClassIds(&visitor); | 20287 v8::V8::VisitHandlesWithClassIds(isolate, &visitor); |
20288 CHECK_EQ(1, visitor.counter_); | 20288 CHECK_EQ(1, visitor.counter_); |
20289 | 20289 |
20290 object.Reset(); | 20290 object.Reset(); |
20291 } | 20291 } |
20292 | 20292 |
20293 | 20293 |
20294 TEST(WrapperClassId) { | 20294 TEST(WrapperClassId) { |
20295 LocalContext context; | 20295 LocalContext context; |
20296 v8::Isolate* isolate = context->GetIsolate(); | 20296 v8::Isolate* isolate = context->GetIsolate(); |
20297 v8::HandleScope scope(isolate); | 20297 v8::HandleScope scope(isolate); |
(...skipping 3495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
23793 char chunk2[] = | 23793 char chunk2[] = |
23794 "XXr = 13;\n" | 23794 "XXr = 13;\n" |
23795 " return foob\xeb\x91\x80\xeb\x91\x80r;\n" | 23795 " return foob\xeb\x91\x80\xeb\x91\x80r;\n" |
23796 "}\n"; | 23796 "}\n"; |
23797 chunk1[strlen(chunk1) - 1] = reference[0]; | 23797 chunk1[strlen(chunk1) - 1] = reference[0]; |
23798 chunk2[0] = reference[1]; | 23798 chunk2[0] = reference[1]; |
23799 chunk2[1] = reference[2]; | 23799 chunk2[1] = reference[2]; |
23800 const char* chunks[] = {chunk1, chunk2, "foo();", NULL}; | 23800 const char* chunks[] = {chunk1, chunk2, "foo();", NULL}; |
23801 RunStreamingTest(chunks, v8::ScriptCompiler::StreamedSource::UTF8); | 23801 RunStreamingTest(chunks, v8::ScriptCompiler::StreamedSource::UTF8); |
23802 } | 23802 } |
OLD | NEW |