| 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 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 configurable: desc.isConfigurable() }; | 379 configurable: desc.isConfigurable() }; |
| 380 } | 380 } |
| 381 | 381 |
| 382 | 382 |
| 383 // Harmony Proxies | 383 // Harmony Proxies |
| 384 function FromGenericPropertyDescriptor(desc) { | 384 function FromGenericPropertyDescriptor(desc) { |
| 385 if (IS_UNDEFINED(desc)) return desc; | 385 if (IS_UNDEFINED(desc)) return desc; |
| 386 var obj = new $Object(); | 386 var obj = new $Object(); |
| 387 | 387 |
| 388 if (desc.hasValue()) { | 388 if (desc.hasValue()) { |
| 389 %IgnoreAttributesAndSetProperty(obj, "value", desc.getValue(), NONE); | 389 %DefineProperty(obj, "value", desc.getValue(), NONE); |
| 390 } | 390 } |
| 391 if (desc.hasWritable()) { | 391 if (desc.hasWritable()) { |
| 392 %IgnoreAttributesAndSetProperty(obj, "writable", desc.isWritable(), NONE); | 392 %DefineProperty(obj, "writable", desc.isWritable(), NONE); |
| 393 } | 393 } |
| 394 if (desc.hasGetter()) { | 394 if (desc.hasGetter()) { |
| 395 %IgnoreAttributesAndSetProperty(obj, "get", desc.getGet(), NONE); | 395 %DefineProperty(obj, "get", desc.getGet(), NONE); |
| 396 } | 396 } |
| 397 if (desc.hasSetter()) { | 397 if (desc.hasSetter()) { |
| 398 %IgnoreAttributesAndSetProperty(obj, "set", desc.getSet(), NONE); | 398 %DefineProperty(obj, "set", desc.getSet(), NONE); |
| 399 } | 399 } |
| 400 if (desc.hasEnumerable()) { | 400 if (desc.hasEnumerable()) { |
| 401 %IgnoreAttributesAndSetProperty(obj, "enumerable", | 401 %DefineProperty(obj, "enumerable", desc.isEnumerable(), NONE); |
| 402 desc.isEnumerable(), NONE); | |
| 403 } | 402 } |
| 404 if (desc.hasConfigurable()) { | 403 if (desc.hasConfigurable()) { |
| 405 %IgnoreAttributesAndSetProperty(obj, "configurable", | 404 %DefineProperty(obj, "configurable", desc.isConfigurable(), NONE); |
| 406 desc.isConfigurable(), NONE); | |
| 407 } | 405 } |
| 408 return obj; | 406 return obj; |
| 409 } | 407 } |
| 410 | 408 |
| 411 | 409 |
| 412 // ES5 8.10.5. | 410 // ES5 8.10.5. |
| 413 function ToPropertyDescriptor(obj) { | 411 function ToPropertyDescriptor(obj) { |
| 414 if (!IS_SPEC_OBJECT(obj)) { | 412 if (!IS_SPEC_OBJECT(obj)) { |
| 415 throw MakeTypeError("property_desc_object", [obj]); | 413 throw MakeTypeError("property_desc_object", [obj]); |
| 416 } | 414 } |
| (...skipping 1435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1852 %SetCode($Function, FunctionConstructor); | 1850 %SetCode($Function, FunctionConstructor); |
| 1853 %DefineProperty($Function.prototype, "constructor", $Function, DONT_ENUM); | 1851 %DefineProperty($Function.prototype, "constructor", $Function, DONT_ENUM); |
| 1854 | 1852 |
| 1855 InstallFunctions($Function.prototype, DONT_ENUM, $Array( | 1853 InstallFunctions($Function.prototype, DONT_ENUM, $Array( |
| 1856 "bind", FunctionBind, | 1854 "bind", FunctionBind, |
| 1857 "toString", FunctionToString | 1855 "toString", FunctionToString |
| 1858 )); | 1856 )); |
| 1859 } | 1857 } |
| 1860 | 1858 |
| 1861 SetUpFunction(); | 1859 SetUpFunction(); |
| OLD | NEW |