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

Unified Diff: src/object-observe.js

Issue 11802003: Add API for access checks on observed objects (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/messages.js ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/object-observe.js
diff --git a/src/object-observe.js b/src/object-observe.js
index d0a84f69c3eec5e45eec71043bdc52cccb829759..8ac8295c3dc3dfda28aad63abec3ab58d5849b42 100644
--- a/src/object-observe.js
+++ b/src/object-observe.js
@@ -74,6 +74,10 @@ function ObjectObserve(object, callback) {
if (ObjectIsFrozen(callback))
throw MakeTypeError("observe_callback_frozen");
+ // Not part of the spec, but also not allowed
+ if (!%ObjectObserveAllowed(object))
+ throw MakeTypeError("observe_access_check_failed");
+
if (!observerInfoMap.has(callback)) {
observerInfoMap.set(callback, {
pendingChangeRecords: null,
« no previous file with comments | « src/messages.js ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698