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

Unified Diff: src/object-observe.js

Issue 1154483002: Hook up more import/exports in natives. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: do not leak utils object Created 5 years, 7 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/prologue.js » ('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 c90c6c7af1d058387ed6482be045009c4587a25a..219d7b72d521c3b2b9cbde526c04ce06294dd829 100644
--- a/src/object-observe.js
+++ b/src/object-observe.js
@@ -23,6 +23,14 @@ var GlobalArray = global.Array;
var GlobalObject = global.Object;
var InternalArray = utils.InternalArray;
+var ObjectFreeze;
+var ObjectIsFrozen;
+
+utils.Import(function(from) {
+ ObjectFreeze = from.ObjectFreeze;
+ ObjectIsFrozen = from.ObjectIsFrozen;
+});
+
// -------------------------------------------------------------------
// Overview:
@@ -380,7 +388,7 @@ function ObjectObserve(object, callback, acceptList) {
throw MakeTypeError(kObserveGlobalProxy, "observe");
if (!IS_SPEC_FUNCTION(callback))
throw MakeTypeError(kObserveNonFunction, "observe");
- if ($objectIsFrozen(callback))
+ if (ObjectIsFrozen(callback))
throw MakeTypeError(kObserveCallbackFrozen);
var objectObserveFn = %GetObjectContextObjectObserve(object);
@@ -473,7 +481,7 @@ function ObjectInfoEnqueueExternalChangeRecord(objectInfo, changeRecord, type) {
%DefineDataPropertyUnchecked(
newRecord, prop, changeRecord[prop], READ_ONLY + DONT_DELETE);
}
- $objectFreeze(newRecord);
+ ObjectFreeze(newRecord);
ObjectInfoEnqueueInternalChangeRecord(objectInfo, newRecord);
}
@@ -525,8 +533,8 @@ function EnqueueSpliceRecord(array, index, removed, addedCount) {
addedCount: addedCount
};
- $objectFreeze(changeRecord);
- $objectFreeze(changeRecord.removed);
+ ObjectFreeze(changeRecord);
+ ObjectFreeze(changeRecord.removed);
ObjectInfoEnqueueInternalChangeRecord(objectInfo, changeRecord);
}
@@ -550,7 +558,7 @@ function NotifyChange(type, object, name, oldValue) {
};
}
- $objectFreeze(changeRecord);
+ ObjectFreeze(changeRecord);
ObjectInfoEnqueueInternalChangeRecord(objectInfo, changeRecord);
}
@@ -607,7 +615,7 @@ function ObjectGetNotifier(object) {
if (%IsJSGlobalProxy(object))
throw MakeTypeError(kObserveGlobalProxy, "getNotifier");
- if ($objectIsFrozen(object)) return null;
+ if (ObjectIsFrozen(object)) return null;
if (!%ObjectWasCreatedInCurrentOrigin(object)) return null;
@@ -665,17 +673,17 @@ function ObserveMicrotaskRunner() {
// -------------------------------------------------------------------
-$installFunctions(GlobalObject, DONT_ENUM, [
+utils.InstallFunctions(GlobalObject, DONT_ENUM, [
"deliverChangeRecords", ObjectDeliverChangeRecords,
"getNotifier", ObjectGetNotifier,
"observe", ObjectObserve,
"unobserve", ObjectUnobserve
]);
-$installFunctions(GlobalArray, DONT_ENUM, [
+utils.InstallFunctions(GlobalArray, DONT_ENUM, [
"observe", ArrayObserve,
"unobserve", ArrayUnobserve
]);
-$installFunctions(notifierPrototype, DONT_ENUM, [
+utils.InstallFunctions(notifierPrototype, DONT_ENUM, [
"notify", ObjectNotifierNotify,
"performChange", ObjectNotifierPerformChange
]);
« no previous file with comments | « src/messages.js ('k') | src/prologue.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698