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

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

Issue 405803006: Unflag symbols (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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
« no previous file with comments | « src/flag-definitions.h ('k') | test/cctest/test-heap-profiler.cc » ('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 2719 matching lines...) Expand 10 before | Expand all | Expand 10 after
2730 { 2730 {
2731 // Re-attach global proxy to a new context, hash should stay the same. 2731 // Re-attach global proxy to a new context, hash should stay the same.
2732 LocalContext env2(NULL, Handle<ObjectTemplate>(), global_proxy); 2732 LocalContext env2(NULL, Handle<ObjectTemplate>(), global_proxy);
2733 int hash3 = global_proxy->GetIdentityHash(); 2733 int hash3 = global_proxy->GetIdentityHash();
2734 CHECK_EQ(hash1, hash3); 2734 CHECK_EQ(hash1, hash3);
2735 } 2735 }
2736 } 2736 }
2737 2737
2738 2738
2739 THREADED_TEST(SymbolProperties) { 2739 THREADED_TEST(SymbolProperties) {
2740 i::FLAG_harmony_symbols = true;
2741
2742 LocalContext env; 2740 LocalContext env;
2743 v8::Isolate* isolate = env->GetIsolate(); 2741 v8::Isolate* isolate = env->GetIsolate();
2744 v8::HandleScope scope(isolate); 2742 v8::HandleScope scope(isolate);
2745 2743
2746 v8::Local<v8::Object> obj = v8::Object::New(isolate); 2744 v8::Local<v8::Object> obj = v8::Object::New(isolate);
2747 v8::Local<v8::Symbol> sym1 = v8::Symbol::New(isolate); 2745 v8::Local<v8::Symbol> sym1 = v8::Symbol::New(isolate);
2748 v8::Local<v8::Symbol> sym2 = 2746 v8::Local<v8::Symbol> sym2 =
2749 v8::Symbol::New(isolate, v8_str("my-symbol")); 2747 v8::Symbol::New(isolate, v8_str("my-symbol"));
2750 2748
2751 CcTest::heap()->CollectAllGarbage(i::Heap::kNoGCFlags); 2749 CcTest::heap()->CollectAllGarbage(i::Heap::kNoGCFlags);
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
2880 // Private properties are inherited (for the time being). 2878 // Private properties are inherited (for the time being).
2881 v8::Local<v8::Object> child = v8::Object::New(isolate); 2879 v8::Local<v8::Object> child = v8::Object::New(isolate);
2882 child->SetPrototype(obj); 2880 child->SetPrototype(obj);
2883 CHECK(child->HasPrivate(priv1)); 2881 CHECK(child->HasPrivate(priv1));
2884 CHECK_EQ(2002, child->GetPrivate(priv1)->Int32Value()); 2882 CHECK_EQ(2002, child->GetPrivate(priv1)->Int32Value());
2885 CHECK_EQ(0, child->GetOwnPropertyNames()->Length()); 2883 CHECK_EQ(0, child->GetOwnPropertyNames()->Length());
2886 } 2884 }
2887 2885
2888 2886
2889 THREADED_TEST(GlobalSymbols) { 2887 THREADED_TEST(GlobalSymbols) {
2890 i::FLAG_harmony_symbols = true;
2891
2892 LocalContext env; 2888 LocalContext env;
2893 v8::Isolate* isolate = env->GetIsolate(); 2889 v8::Isolate* isolate = env->GetIsolate();
2894 v8::HandleScope scope(isolate); 2890 v8::HandleScope scope(isolate);
2895 2891
2896 v8::Local<String> name = v8_str("my-symbol"); 2892 v8::Local<String> name = v8_str("my-symbol");
2897 v8::Local<v8::Symbol> glob = v8::Symbol::For(isolate, name); 2893 v8::Local<v8::Symbol> glob = v8::Symbol::For(isolate, name);
2898 v8::Local<v8::Symbol> glob2 = v8::Symbol::For(isolate, name); 2894 v8::Local<v8::Symbol> glob2 = v8::Symbol::For(isolate, name);
2899 CHECK(glob2->SameValue(glob)); 2895 CHECK(glob2->SameValue(glob));
2900 2896
2901 v8::Local<v8::Symbol> glob_api = v8::Symbol::ForApi(isolate, name); 2897 v8::Local<v8::Symbol> glob_api = v8::Symbol::ForApi(isolate, name);
(...skipping 18486 matching lines...) Expand 10 before | Expand all | Expand 10 after
21388 v8::HandleScope scope(isolate); 21384 v8::HandleScope scope(isolate);
21389 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); 21385 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate);
21390 Local<Object> obj = templ->NewInstance(); 21386 Local<Object> obj = templ->NewInstance();
21391 obj->GetIdentityHash(); 21387 obj->GetIdentityHash();
21392 obj->DeleteHiddenValue(v8_str("Bug")); 21388 obj->DeleteHiddenValue(v8_str("Bug"));
21393 } 21389 }
21394 21390
21395 21391
21396 THREADED_TEST(Regress2535) { 21392 THREADED_TEST(Regress2535) {
21397 i::FLAG_harmony_collections = true; 21393 i::FLAG_harmony_collections = true;
21398 i::FLAG_harmony_symbols = true;
21399 LocalContext context; 21394 LocalContext context;
21400 v8::HandleScope scope(context->GetIsolate()); 21395 v8::HandleScope scope(context->GetIsolate());
21401 Local<Value> set_value = CompileRun("new Set();"); 21396 Local<Value> set_value = CompileRun("new Set();");
21402 Local<Object> set_object(Local<Object>::Cast(set_value)); 21397 Local<Object> set_object(Local<Object>::Cast(set_value));
21403 CHECK_EQ(0, set_object->InternalFieldCount()); 21398 CHECK_EQ(0, set_object->InternalFieldCount());
21404 Local<Value> map_value = CompileRun("new Map();"); 21399 Local<Value> map_value = CompileRun("new Map();");
21405 Local<Object> map_object(Local<Object>::Cast(map_value)); 21400 Local<Object> map_object(Local<Object>::Cast(map_value));
21406 CHECK_EQ(0, map_object->InternalFieldCount()); 21401 CHECK_EQ(0, map_object->InternalFieldCount());
21407 } 21402 }
21408 21403
(...skipping 1419 matching lines...) Expand 10 before | Expand all | Expand 10 after
22828 desc = x->GetOwnPropertyDescriptor(v8_str("p1")); 22823 desc = x->GetOwnPropertyDescriptor(v8_str("p1"));
22829 Local<Function> set = 22824 Local<Function> set =
22830 Local<Function>::Cast(Local<Object>::Cast(desc)->Get(v8_str("set"))); 22825 Local<Function>::Cast(Local<Object>::Cast(desc)->Get(v8_str("set")));
22831 Local<Function> get = 22826 Local<Function> get =
22832 Local<Function>::Cast(Local<Object>::Cast(desc)->Get(v8_str("get"))); 22827 Local<Function>::Cast(Local<Object>::Cast(desc)->Get(v8_str("get")));
22833 CHECK_EQ(v8_num(13), get->Call(x, 0, NULL)); 22828 CHECK_EQ(v8_num(13), get->Call(x, 0, NULL));
22834 Handle<Value> args[] = { v8_num(14) }; 22829 Handle<Value> args[] = { v8_num(14) };
22835 set->Call(x, 1, args); 22830 set->Call(x, 1, args);
22836 CHECK_EQ(v8_num(14), get->Call(x, 0, NULL)); 22831 CHECK_EQ(v8_num(14), get->Call(x, 0, NULL));
22837 } 22832 }
OLDNEW
« no previous file with comments | « src/flag-definitions.h ('k') | test/cctest/test-heap-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698