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

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

Issue 1230793002: [es6] silence access-check failure for well-known symbol properties (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: remove test copy-pasta Created 5 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
« no previous file with comments | « src/runtime/runtime-array.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 21837 matching lines...) Expand 10 before | Expand all | Expand 10 after
21848 " fake.age;\n" 21848 " fake.age;\n"
21849 " result = 1;\n" 21849 " result = 1;\n"
21850 " } catch (e) {\n" 21850 " } catch (e) {\n"
21851 " }\n" 21851 " }\n"
21852 " test(d+1);\n" 21852 " test(d+1);\n"
21853 "}\n" 21853 "}\n"
21854 "test(0);\n" 21854 "test(0);\n"
21855 "result;\n", 21855 "result;\n",
21856 0); 21856 0);
21857 } 21857 }
21858
21859
21860 static bool AccessSymbolsAlwaysBlocked(Local<v8::Object> global,
21861 Local<Value> name, v8::AccessType type,
21862 Local<Value> data) {
21863 if (!name->IsSymbol()) return true;
Toon Verwaest 2015/07/10 13:22:16 Access checks are in the process of being rewritte
21864 i::PrintF("Access blocked.\n");
21865 return false;
21866 }
21867
21868
21869 THREADED_TEST(Regress507553) {
21870 v8::Isolate* isolate = CcTest::isolate();
21871 HandleScope scope(isolate);
21872
21873 // Template for object with security check.
21874 Local<ObjectTemplate> spreadable_template = v8::ObjectTemplate::New(isolate);
21875 spreadable_template->SetAccessCheckCallbacks(AccessSymbolsAlwaysBlocked,
21876 NULL);
21877
21878 // Context for "foreign" objects used in test.
21879 Local<Context> context = v8::Context::New(isolate);
21880 context->Enter();
21881
21882 // Object with explicit security check.
21883 Local<Object> protected_object = spreadable_template->NewInstance();
21884
21885 spreadable_template->Set(v8::Symbol::GetIsConcatSpreadable(isolate),
21886 v8::Boolean::New(isolate, true));
21887
21888 protected_object->Set(v8_str("length"), v8::Integer::New(isolate, 2));
21889 protected_object->Set(0U, v8_str("a"));
21890 protected_object->Set(1U, v8_str("b"));
21891
21892 Local<ObjectTemplate> global_template = ObjectTemplate::New(isolate);
21893 global_template->Set(v8_str("protected"), protected_object);
21894
21895 context->Exit();
21896
21897 LocalContext context2(NULL, global_template);
21898
21899 Local<Value> result1 = CompileRun("[].concat(protected)");
21900 CHECK(result1->IsArray());
21901 CHECK(result1.As<Object>()->Get(0)->Equals(protected_object));
21902 }
OLDNEW
« no previous file with comments | « src/runtime/runtime-array.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698