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

Side by Side Diff: test/cctest/test-object-observe.cc

Issue 124943004: Prepare removal of ObjectTemplate::New without Isolate parameter. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Do not remove ObjectTemplate::New() yet. Created 6 years, 11 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 | « test/cctest/test-heap-profiler.cc ('k') | test/cctest/test-platform.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 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 Handle<Object> global = isolate->GetCurrentContext()->Global(); 510 Handle<Object> global = isolate->GetCurrentContext()->Global();
511 return type != ACCESS_KEYS || !global->Has(kBlockedContextIndex); 511 return type != ACCESS_KEYS || !global->Has(kBlockedContextIndex);
512 } 512 }
513 513
514 514
515 static Handle<Object> CreateAccessCheckedObject( 515 static Handle<Object> CreateAccessCheckedObject(
516 v8::Isolate* isolate, 516 v8::Isolate* isolate,
517 NamedSecurityCallback namedCallback, 517 NamedSecurityCallback namedCallback,
518 IndexedSecurityCallback indexedCallback, 518 IndexedSecurityCallback indexedCallback,
519 Handle<Value> data = Handle<Value>()) { 519 Handle<Value> data = Handle<Value>()) {
520 Handle<ObjectTemplate> tmpl = ObjectTemplate::New(); 520 Handle<ObjectTemplate> tmpl = ObjectTemplate::New(isolate);
521 tmpl->SetAccessCheckCallbacks(namedCallback, indexedCallback, data); 521 tmpl->SetAccessCheckCallbacks(namedCallback, indexedCallback, data);
522 Handle<Object> instance = tmpl->NewInstance(); 522 Handle<Object> instance = tmpl->NewInstance();
523 Handle<Object> global = instance->CreationContext()->Global(); 523 Handle<Object> global = instance->CreationContext()->Global();
524 global->Set(String::NewFromUtf8(isolate, "obj"), instance); 524 global->Set(String::NewFromUtf8(isolate, "obj"), instance);
525 global->Set(kBlockedContextIndex, v8::True(isolate)); 525 global->Set(kBlockedContextIndex, v8::True(isolate));
526 return instance; 526 return instance;
527 } 527 }
528 528
529 529
530 TEST(NamedAccessCheck) { 530 TEST(NamedAccessCheck) {
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 "var observer = function(r) { records = r };" 757 "var observer = function(r) { records = r };"
758 "Object.observe(obj, observer);"); 758 "Object.observe(obj, observer);");
759 Handle<Value> obj = 759 Handle<Value> obj =
760 context->Global()->Get(String::NewFromUtf8(isolate.GetIsolate(), "obj")); 760 context->Global()->Get(String::NewFromUtf8(isolate.GetIsolate(), "obj"));
761 Handle<Object>::Cast(obj) 761 Handle<Object>::Cast(obj)
762 ->SetHiddenValue(String::NewFromUtf8(isolate.GetIsolate(), "foo"), 762 ->SetHiddenValue(String::NewFromUtf8(isolate.GetIsolate(), "foo"),
763 Null(isolate.GetIsolate())); 763 Null(isolate.GetIsolate()));
764 CompileRun(""); // trigger delivery 764 CompileRun(""); // trigger delivery
765 CHECK(CompileRun("records")->IsNull()); 765 CHECK(CompileRun("records")->IsNull());
766 } 766 }
OLDNEW
« no previous file with comments | « test/cctest/test-heap-profiler.cc ('k') | test/cctest/test-platform.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698