OLD | NEW |
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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 | 277 |
278 function AcceptArgIsValid(arg) { | 278 function AcceptArgIsValid(arg) { |
279 if (IS_UNDEFINED(arg)) | 279 if (IS_UNDEFINED(arg)) |
280 return true; | 280 return true; |
281 | 281 |
282 if (!IS_SPEC_OBJECT(arg) || | 282 if (!IS_SPEC_OBJECT(arg) || |
283 !IS_NUMBER(arg.length) || | 283 !IS_NUMBER(arg.length) || |
284 arg.length < 0) | 284 arg.length < 0) |
285 return false; | 285 return false; |
286 | 286 |
| 287 var length = arg.length; |
| 288 for (var i = 0; i < length; i++) { |
| 289 if (!IS_STRING(arg[i])) |
| 290 return false; |
| 291 } |
287 return true; | 292 return true; |
288 } | 293 } |
289 | 294 |
290 // CallbackInfo's optimized state is just a number which represents its global | 295 // CallbackInfo's optimized state is just a number which represents its global |
291 // priority. When a change record must be enqueued for the callback, it | 296 // priority. When a change record must be enqueued for the callback, it |
292 // normalizes. When delivery clears any pending change records, it re-optimizes. | 297 // normalizes. When delivery clears any pending change records, it re-optimizes. |
293 function CallbackInfoGet(callback) { | 298 function CallbackInfoGet(callback) { |
294 return callbackInfoMap.get(callback); | 299 return callbackInfoMap.get(callback); |
295 } | 300 } |
296 | 301 |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 "observe", ArrayObserve, | 564 "observe", ArrayObserve, |
560 "unobserve", ArrayUnobserve | 565 "unobserve", ArrayUnobserve |
561 )); | 566 )); |
562 InstallFunctions(notifierPrototype, DONT_ENUM, $Array( | 567 InstallFunctions(notifierPrototype, DONT_ENUM, $Array( |
563 "notify", ObjectNotifierNotify, | 568 "notify", ObjectNotifierNotify, |
564 "performChange", ObjectNotifierPerformChange | 569 "performChange", ObjectNotifierPerformChange |
565 )); | 570 )); |
566 } | 571 } |
567 | 572 |
568 SetupObjectObserve(); | 573 SetupObjectObserve(); |
OLD | NEW |