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

Side by Side Diff: src/isolate.cc

Issue 428733007: Throw an exception when an access check fails and no external callback is installed (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: s/ReferenceError/TypeError/ per Toon's wish Created 6 years, 4 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 | « no previous file | src/mirror-debugger.js » ('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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdlib.h> 5 #include <stdlib.h>
6 6
7 #include "src/v8.h" 7 #include "src/v8.h"
8 8
9 #include "src/ast.h" 9 #include "src/ast.h"
10 #include "src/base/platform/platform.h" 10 #include "src/base/platform/platform.h"
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 Object* data_obj = 631 Object* data_obj =
632 constructor->shared()->get_api_func_data()->access_check_info(); 632 constructor->shared()->get_api_func_data()->access_check_info();
633 if (data_obj == isolate->heap()->undefined_value()) return NULL; 633 if (data_obj == isolate->heap()->undefined_value()) return NULL;
634 634
635 return AccessCheckInfo::cast(data_obj); 635 return AccessCheckInfo::cast(data_obj);
636 } 636 }
637 637
638 638
639 void Isolate::ReportFailedAccessCheck(Handle<JSObject> receiver, 639 void Isolate::ReportFailedAccessCheck(Handle<JSObject> receiver,
640 v8::AccessType type) { 640 v8::AccessType type) {
641 if (!thread_local_top()->failed_access_check_callback_) return; 641 if (!thread_local_top()->failed_access_check_callback_) {
642 Handle<String> message = factory()->InternalizeUtf8String("no access");
643 ScheduleThrow(*factory()->NewTypeError(message));
644 return;
645 }
642 646
643 ASSERT(receiver->IsAccessCheckNeeded()); 647 ASSERT(receiver->IsAccessCheckNeeded());
644 ASSERT(context()); 648 ASSERT(context());
645 649
646 // Get the data object from access check info. 650 // Get the data object from access check info.
647 HandleScope scope(this); 651 HandleScope scope(this);
648 Handle<Object> data; 652 Handle<Object> data;
649 { DisallowHeapAllocation no_gc; 653 { DisallowHeapAllocation no_gc;
650 AccessCheckInfo* access_check_info = GetAccessCheckInfo(this, receiver); 654 AccessCheckInfo* access_check_info = GetAccessCheckInfo(this, receiver);
651 if (!access_check_info) return; 655 if (!access_check_info) return;
(...skipping 1706 matching lines...) Expand 10 before | Expand all | Expand 10 after
2358 if (prev_ && prev_->Intercept(flag)) return true; 2362 if (prev_ && prev_->Intercept(flag)) return true;
2359 // Then check whether this scope intercepts. 2363 // Then check whether this scope intercepts.
2360 if ((flag & intercept_mask_)) { 2364 if ((flag & intercept_mask_)) {
2361 intercepted_flags_ |= flag; 2365 intercepted_flags_ |= flag;
2362 return true; 2366 return true;
2363 } 2367 }
2364 return false; 2368 return false;
2365 } 2369 }
2366 2370
2367 } } // namespace v8::internal 2371 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/mirror-debugger.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698