OLD | NEW |
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 // This file relies on the fact that the following declarations have been made | 5 // This file relies on the fact that the following declarations have been made |
6 // in runtime.js: | 6 // in runtime.js: |
7 // var $Object = global.Object; | 7 // var $Object = global.Object; |
8 // var $Boolean = global.Boolean; | 8 // var $Boolean = global.Boolean; |
9 // var $Number = global.Number; | 9 // var $Number = global.Number; |
10 // var $Function = global.Function; | 10 // var $Function = global.Function; |
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 "hasWritable_", | 493 "hasWritable_", |
494 "enumerable_", | 494 "enumerable_", |
495 "hasEnumerable_", | 495 "hasEnumerable_", |
496 "configurable_", | 496 "configurable_", |
497 "hasConfigurable_", | 497 "hasConfigurable_", |
498 "get_", | 498 "get_", |
499 "hasGetter_", | 499 "hasGetter_", |
500 "set_", | 500 "set_", |
501 "hasSetter_" | 501 "hasSetter_" |
502 ), $Array( | 502 ), $Array( |
503 "toString", function() { | 503 "toString", function PropertyDescriptor_ToString() { |
504 return "[object PropertyDescriptor]"; | 504 return "[object PropertyDescriptor]"; |
505 }, | 505 }, |
506 "setValue", function(value) { | 506 "setValue", function PropertyDescriptor_SetValue(value) { |
507 this.value_ = value; | 507 this.value_ = value; |
508 this.hasValue_ = true; | 508 this.hasValue_ = true; |
509 }, | 509 }, |
510 "getValue", function() { | 510 "getValue", function PropertyDescriptor_GetValue() { |
511 return this.value_; | 511 return this.value_; |
512 }, | 512 }, |
513 "hasValue", function() { | 513 "hasValue", function PropertyDescriptor_HasValue() { |
514 return this.hasValue_; | 514 return this.hasValue_; |
515 }, | 515 }, |
516 "setEnumerable", function(enumerable) { | 516 "setEnumerable", function PropertyDescriptor_SetEnumerable(enumerable) { |
517 this.enumerable_ = enumerable; | 517 this.enumerable_ = enumerable; |
518 this.hasEnumerable_ = true; | 518 this.hasEnumerable_ = true; |
519 }, | 519 }, |
520 "isEnumerable", function () { | 520 "isEnumerable", function PropertyDescriptor_IsEnumerable() { |
521 return this.enumerable_; | 521 return this.enumerable_; |
522 }, | 522 }, |
523 "hasEnumerable", function() { | 523 "hasEnumerable", function PropertyDescriptor_HasEnumerable() { |
524 return this.hasEnumerable_; | 524 return this.hasEnumerable_; |
525 }, | 525 }, |
526 "setWritable", function(writable) { | 526 "setWritable", function PropertyDescriptor_SetWritable(writable) { |
527 this.writable_ = writable; | 527 this.writable_ = writable; |
528 this.hasWritable_ = true; | 528 this.hasWritable_ = true; |
529 }, | 529 }, |
530 "isWritable", function() { | 530 "isWritable", function PropertyDescriptor_IsWritable() { |
531 return this.writable_; | 531 return this.writable_; |
532 }, | 532 }, |
533 "hasWritable", function() { | 533 "hasWritable", function PropertyDescriptor_HasWritable() { |
534 return this.hasWritable_; | 534 return this.hasWritable_; |
535 }, | 535 }, |
536 "setConfigurable", function(configurable) { | 536 "setConfigurable", |
| 537 function PropertyDescriptor_SetConfigurable(configurable) { |
537 this.configurable_ = configurable; | 538 this.configurable_ = configurable; |
538 this.hasConfigurable_ = true; | 539 this.hasConfigurable_ = true; |
539 }, | 540 }, |
540 "hasConfigurable", function() { | 541 "hasConfigurable", function PropertyDescriptor_HasConfigurable() { |
541 return this.hasConfigurable_; | 542 return this.hasConfigurable_; |
542 }, | 543 }, |
543 "isConfigurable", function() { | 544 "isConfigurable", function PropertyDescriptor_IsConfigurable() { |
544 return this.configurable_; | 545 return this.configurable_; |
545 }, | 546 }, |
546 "setGet", function(get) { | 547 "setGet", function PropertyDescriptor_SetGetter(get) { |
547 this.get_ = get; | 548 this.get_ = get; |
548 this.hasGetter_ = true; | 549 this.hasGetter_ = true; |
549 }, | 550 }, |
550 "getGet", function() { | 551 "getGet", function PropertyDescriptor_GetGetter() { |
551 return this.get_; | 552 return this.get_; |
552 }, | 553 }, |
553 "hasGetter", function() { | 554 "hasGetter", function PropertyDescriptor_HasGetter() { |
554 return this.hasGetter_; | 555 return this.hasGetter_; |
555 }, | 556 }, |
556 "setSet", function(set) { | 557 "setSet", function PropertyDescriptor_SetSetter(set) { |
557 this.set_ = set; | 558 this.set_ = set; |
558 this.hasSetter_ = true; | 559 this.hasSetter_ = true; |
559 }, | 560 }, |
560 "getSet", function() { | 561 "getSet", function PropertyDescriptor_GetSetter() { |
561 return this.set_; | 562 return this.set_; |
562 }, | 563 }, |
563 "hasSetter", function() { | 564 "hasSetter", function PropertyDescriptor_HasSetter() { |
564 return this.hasSetter_; | 565 return this.hasSetter_; |
565 })); | 566 })); |
566 | 567 |
567 | 568 |
568 // Converts an array returned from Runtime_GetOwnProperty to an actual | 569 // Converts an array returned from Runtime_GetOwnProperty to an actual |
569 // property descriptor. For a description of the array layout please | 570 // property descriptor. For a description of the array layout please |
570 // see the runtime.cc file. | 571 // see the runtime.cc file. |
571 function ConvertDescriptorArrayToDescriptor(desc_array) { | 572 function ConvertDescriptorArrayToDescriptor(desc_array) { |
572 if (IS_UNDEFINED(desc_array)) { | 573 if (IS_UNDEFINED(desc_array)) { |
573 return UNDEFINED; | 574 return UNDEFINED; |
(...skipping 1332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1906 } | 1907 } |
1907 if (!IS_SPEC_FUNCTION(method)) { | 1908 if (!IS_SPEC_FUNCTION(method)) { |
1908 throw MakeTypeError('not_iterable', [obj]); | 1909 throw MakeTypeError('not_iterable', [obj]); |
1909 } | 1910 } |
1910 var iterator = %_CallFunction(obj, method); | 1911 var iterator = %_CallFunction(obj, method); |
1911 if (!IS_SPEC_OBJECT(iterator)) { | 1912 if (!IS_SPEC_OBJECT(iterator)) { |
1912 throw MakeTypeError('not_an_iterator', [iterator]); | 1913 throw MakeTypeError('not_an_iterator', [iterator]); |
1913 } | 1914 } |
1914 return iterator; | 1915 return iterator; |
1915 } | 1916 } |
OLD | NEW |