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/bootstrapper.h" | 5 #include "src/bootstrapper.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api-natives.h" | 8 #include "src/api-natives.h" |
9 #include "src/base/utils/random-number-generator.h" | 9 #include "src/base/utils/random-number-generator.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 // %ThrowTypeError% must not have a name property. | 691 // %ThrowTypeError% must not have a name property. |
692 JSReceiver::DeleteProperty(function, factory()->name_string()).Assert(); | 692 JSReceiver::DeleteProperty(function, factory()->name_string()).Assert(); |
693 | 693 |
694 // length needs to be non configurable. | 694 // length needs to be non configurable. |
695 Handle<Object> value(Smi::FromInt(function->shared()->length()), isolate()); | 695 Handle<Object> value(Smi::FromInt(function->shared()->length()), isolate()); |
696 JSObject::SetOwnPropertyIgnoreAttributes( | 696 JSObject::SetOwnPropertyIgnoreAttributes( |
697 function, factory()->length_string(), value, | 697 function, factory()->length_string(), value, |
698 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY)) | 698 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY)) |
699 .Assert(); | 699 .Assert(); |
700 | 700 |
701 JSObject::PreventExtensions(function).Assert(); | 701 if (JSObject::PreventExtensions(function, THROW_ON_ERROR).IsNothing()) |
| 702 DCHECK(false); |
702 | 703 |
703 return function; | 704 return function; |
704 } | 705 } |
705 | 706 |
706 | 707 |
707 // ECMAScript 5th Edition, 13.2.3 | 708 // ECMAScript 5th Edition, 13.2.3 |
708 Handle<JSFunction> Genesis::GetRestrictedFunctionPropertiesThrower() { | 709 Handle<JSFunction> Genesis::GetRestrictedFunctionPropertiesThrower() { |
709 if (restricted_function_properties_thrower_.is_null()) { | 710 if (restricted_function_properties_thrower_.is_null()) { |
710 restricted_function_properties_thrower_ = GetThrowTypeErrorIntrinsic( | 711 restricted_function_properties_thrower_ = GetThrowTypeErrorIntrinsic( |
711 Builtins::kRestrictedFunctionPropertiesThrower); | 712 Builtins::kRestrictedFunctionPropertiesThrower); |
(...skipping 1206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1918 JSObject::AddProperty(global, reflect_string, reflect, DONT_ENUM); | 1919 JSObject::AddProperty(global, reflect_string, reflect, DONT_ENUM); |
1919 | 1920 |
1920 SimpleInstallFunction(reflect, "deleteProperty", | 1921 SimpleInstallFunction(reflect, "deleteProperty", |
1921 Builtins::kReflectDeleteProperty, 2, true); | 1922 Builtins::kReflectDeleteProperty, 2, true); |
1922 SimpleInstallFunction(reflect, "get", | 1923 SimpleInstallFunction(reflect, "get", |
1923 Builtins::kReflectGet, 3, false); | 1924 Builtins::kReflectGet, 3, false); |
1924 SimpleInstallFunction(reflect, "has", | 1925 SimpleInstallFunction(reflect, "has", |
1925 Builtins::kReflectHas, 2, true); | 1926 Builtins::kReflectHas, 2, true); |
1926 SimpleInstallFunction(reflect, "isExtensible", | 1927 SimpleInstallFunction(reflect, "isExtensible", |
1927 Builtins::kReflectIsExtensible, 1, true); | 1928 Builtins::kReflectIsExtensible, 1, true); |
| 1929 SimpleInstallFunction(reflect, "preventExtensions", |
| 1930 Builtins::kReflectPreventExtensions, 1, true); |
1928 } | 1931 } |
1929 | 1932 |
1930 | 1933 |
1931 void Genesis::InitializeGlobal_harmony_sharedarraybuffer() { | 1934 void Genesis::InitializeGlobal_harmony_sharedarraybuffer() { |
1932 if (!FLAG_harmony_sharedarraybuffer) return; | 1935 if (!FLAG_harmony_sharedarraybuffer) return; |
1933 | 1936 |
1934 Handle<JSGlobalObject> global( | 1937 Handle<JSGlobalObject> global( |
1935 JSGlobalObject::cast(native_context()->global_object())); | 1938 JSGlobalObject::cast(native_context()->global_object())); |
1936 | 1939 |
1937 Handle<JSFunction> shared_array_buffer_fun = InstallFunction( | 1940 Handle<JSFunction> shared_array_buffer_fun = InstallFunction( |
(...skipping 1358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3296 } | 3299 } |
3297 | 3300 |
3298 | 3301 |
3299 // Called when the top-level V8 mutex is destroyed. | 3302 // Called when the top-level V8 mutex is destroyed. |
3300 void Bootstrapper::FreeThreadResources() { | 3303 void Bootstrapper::FreeThreadResources() { |
3301 DCHECK(!IsActive()); | 3304 DCHECK(!IsActive()); |
3302 } | 3305 } |
3303 | 3306 |
3304 } // namespace internal | 3307 } // namespace internal |
3305 } // namespace v8 | 3308 } // namespace v8 |
OLD | NEW |