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

Side by Side Diff: src/object-observe.js

Issue 1005553003: Fix error message for Object.observe accept argument (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Improve error message, simplify test Created 5 years, 9 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/messages.js ('k') | test/mjsunit/es7/object-observe.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 "use strict"; 5 "use strict";
6 6
7 // Overview: 7 // Overview:
8 // 8 //
9 // This file contains all of the routing and accounting for Object.observe. 9 // This file contains all of the routing and accounting for Object.observe.
10 // User code will interact with these mechanisms via the Object.observe APIs 10 // User code will interact with these mechanisms via the Object.observe APIs
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 function ObjectInfoGetPerformingTypes(objectInfo) { 264 function ObjectInfoGetPerformingTypes(objectInfo) {
265 return objectInfo.performingCount > 0 ? objectInfo.performing : null; 265 return objectInfo.performingCount > 0 ? objectInfo.performing : null;
266 } 266 }
267 267
268 function ConvertAcceptListToTypeMap(arg) { 268 function ConvertAcceptListToTypeMap(arg) {
269 // We use undefined as a sentinel for the default accept list. 269 // We use undefined as a sentinel for the default accept list.
270 if (IS_UNDEFINED(arg)) 270 if (IS_UNDEFINED(arg))
271 return arg; 271 return arg;
272 272
273 if (!IS_SPEC_OBJECT(arg)) 273 if (!IS_SPEC_OBJECT(arg))
274 throw MakeTypeError("observe_accept_invalid"); 274 throw MakeTypeError("observe_invalid_accept");
275 275
276 var len = ToInteger(arg.length); 276 var len = ToInteger(arg.length);
277 if (len < 0) len = 0; 277 if (len < 0) len = 0;
278 278
279 return TypeMapCreateFromList(arg, len); 279 return TypeMapCreateFromList(arg, len);
280 } 280 }
281 281
282 // CallbackInfo's optimized state is just a number which represents its global 282 // CallbackInfo's optimized state is just a number which represents its global
283 // priority. When a change record must be enqueued for the callback, it 283 // priority. When a change record must be enqueued for the callback, it
284 // normalizes. When delivery clears any pending change records, it re-optimizes. 284 // normalizes. When delivery clears any pending change records, it re-optimizes.
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 "observe", ArrayObserve, 604 "observe", ArrayObserve,
605 "unobserve", ArrayUnobserve 605 "unobserve", ArrayUnobserve
606 )); 606 ));
607 InstallFunctions(notifierPrototype, DONT_ENUM, $Array( 607 InstallFunctions(notifierPrototype, DONT_ENUM, $Array(
608 "notify", ObjectNotifierNotify, 608 "notify", ObjectNotifierNotify,
609 "performChange", ObjectNotifierPerformChange 609 "performChange", ObjectNotifierPerformChange
610 )); 610 ));
611 } 611 }
612 612
613 SetupObjectObserve(); 613 SetupObjectObserve();
OLDNEW
« no previous file with comments | « src/messages.js ('k') | test/mjsunit/es7/object-observe.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698