| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
| 8 #include "src/bootstrapper.h" | 8 #include "src/bootstrapper.h" |
| 9 #include "src/debug.h" | 9 #include "src/debug.h" |
| 10 #include "src/messages.h" | 10 #include "src/messages.h" |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, | 450 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, |
| 451 JSObject::PreventExtensions(obj)); | 451 JSObject::PreventExtensions(obj)); |
| 452 return *result; | 452 return *result; |
| 453 } | 453 } |
| 454 | 454 |
| 455 | 455 |
| 456 RUNTIME_FUNCTION(Runtime_IsExtensible) { | 456 RUNTIME_FUNCTION(Runtime_IsExtensible) { |
| 457 SealHandleScope shs(isolate); | 457 SealHandleScope shs(isolate); |
| 458 DCHECK(args.length() == 1); | 458 DCHECK(args.length() == 1); |
| 459 CONVERT_ARG_CHECKED(JSObject, obj, 0); | 459 CONVERT_ARG_CHECKED(JSObject, obj, 0); |
| 460 if (obj->IsJSGlobalProxy()) { | 460 return isolate->heap()->ToBoolean(obj->IsExtensible()); |
| 461 PrototypeIterator iter(isolate, obj); | |
| 462 if (iter.IsAtEnd()) return isolate->heap()->false_value(); | |
| 463 DCHECK(iter.GetCurrent()->IsJSGlobalObject()); | |
| 464 obj = JSObject::cast(iter.GetCurrent()); | |
| 465 } | |
| 466 return isolate->heap()->ToBoolean(obj->map()->is_extensible()); | |
| 467 } | 461 } |
| 468 | 462 |
| 469 | 463 |
| 470 RUNTIME_FUNCTION(Runtime_DisableAccessChecks) { | 464 RUNTIME_FUNCTION(Runtime_DisableAccessChecks) { |
| 471 HandleScope scope(isolate); | 465 HandleScope scope(isolate); |
| 472 DCHECK(args.length() == 1); | 466 DCHECK(args.length() == 1); |
| 473 CONVERT_ARG_HANDLE_CHECKED(HeapObject, object, 0); | 467 CONVERT_ARG_HANDLE_CHECKED(HeapObject, object, 0); |
| 474 Handle<Map> old_map(object->map()); | 468 Handle<Map> old_map(object->map()); |
| 475 bool needs_access_checks = old_map->is_access_check_needed(); | 469 bool needs_access_checks = old_map->is_access_check_needed(); |
| 476 if (needs_access_checks) { | 470 if (needs_access_checks) { |
| (...skipping 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1578 CONVERT_PROPERTY_ATTRIBUTES_CHECKED(attrs, 3); | 1572 CONVERT_PROPERTY_ATTRIBUTES_CHECKED(attrs, 3); |
| 1579 | 1573 |
| 1580 RETURN_FAILURE_ON_EXCEPTION( | 1574 RETURN_FAILURE_ON_EXCEPTION( |
| 1581 isolate, | 1575 isolate, |
| 1582 JSObject::DefineAccessor(object, name, isolate->factory()->null_value(), | 1576 JSObject::DefineAccessor(object, name, isolate->factory()->null_value(), |
| 1583 setter, attrs)); | 1577 setter, attrs)); |
| 1584 return isolate->heap()->undefined_value(); | 1578 return isolate->heap()->undefined_value(); |
| 1585 } | 1579 } |
| 1586 } // namespace internal | 1580 } // namespace internal |
| 1587 } // namespace v8 | 1581 } // namespace v8 |
| OLD | NEW |