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

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

Issue 179983002: initialize v8::Private with v8::String (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
« src/api.cc ('K') | « src/api.cc ('k') | no next file » | 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 2826 matching lines...) Expand 10 before | Expand all | Expand 10 after
2837 } 2837 }
2838 2838
2839 2839
2840 THREADED_TEST(PrivateProperties) { 2840 THREADED_TEST(PrivateProperties) {
2841 LocalContext env; 2841 LocalContext env;
2842 v8::Isolate* isolate = env->GetIsolate(); 2842 v8::Isolate* isolate = env->GetIsolate();
2843 v8::HandleScope scope(isolate); 2843 v8::HandleScope scope(isolate);
2844 2844
2845 v8::Local<v8::Object> obj = v8::Object::New(isolate); 2845 v8::Local<v8::Object> obj = v8::Object::New(isolate);
2846 v8::Local<v8::Private> priv1 = v8::Private::New(isolate); 2846 v8::Local<v8::Private> priv1 = v8::Private::New(isolate);
2847 v8::Local<v8::Private> priv2 = v8::Private::New(isolate, "my-private"); 2847 v8::Local<v8::Private> priv2 = v8::Private::New(isolate,
2848 v8_str("my-private"));
2848 2849
2849 CcTest::heap()->CollectAllGarbage(i::Heap::kNoGCFlags); 2850 CcTest::heap()->CollectAllGarbage(i::Heap::kNoGCFlags);
2850 2851
2851 CHECK(priv2->Name()->Equals(v8::String::NewFromUtf8(isolate, "my-private"))); 2852 CHECK(priv2->Name()->Equals(v8::String::NewFromUtf8(isolate, "my-private")));
2852 2853
2853 // Make sure delete of a non-existent private symbol property works. 2854 // Make sure delete of a non-existent private symbol property works.
2854 CHECK(obj->DeletePrivate(priv1)); 2855 CHECK(obj->DeletePrivate(priv1));
2855 CHECK(!obj->HasPrivate(priv1)); 2856 CHECK(!obj->HasPrivate(priv1));
2856 2857
2857 CHECK(obj->SetPrivate(priv1, v8::Integer::New(isolate, 1503))); 2858 CHECK(obj->SetPrivate(priv1, v8::Integer::New(isolate, 1503)));
(...skipping 19251 matching lines...) Expand 10 before | Expand all | Expand 10 after
22109 Local<Object> ApiCallOptimizationChecker::holder; 22110 Local<Object> ApiCallOptimizationChecker::holder;
22110 Local<Object> ApiCallOptimizationChecker::callee; 22111 Local<Object> ApiCallOptimizationChecker::callee;
22111 int ApiCallOptimizationChecker::count = 0; 22112 int ApiCallOptimizationChecker::count = 0;
22112 22113
22113 22114
22114 TEST(TestFunctionCallOptimization) { 22115 TEST(TestFunctionCallOptimization) {
22115 i::FLAG_allow_natives_syntax = true; 22116 i::FLAG_allow_natives_syntax = true;
22116 ApiCallOptimizationChecker checker; 22117 ApiCallOptimizationChecker checker;
22117 checker.RunAll(); 22118 checker.RunAll();
22118 } 22119 }
OLDNEW
« src/api.cc ('K') | « src/api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698