Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(376)

Side by Side Diff: src/bootstrapper.cc

Issue 1479543002: [proxies] Implement [[Delete]]. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix typo Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/extensions/externalize-string-extension.h" 10 #include "src/extensions/externalize-string-extension.h"
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 Builtins::Name builtin_name) { 680 Builtins::Name builtin_name) {
681 Handle<String> name = 681 Handle<String> name =
682 factory()->InternalizeOneByteString(STATIC_CHAR_VECTOR("ThrowTypeError")); 682 factory()->InternalizeOneByteString(STATIC_CHAR_VECTOR("ThrowTypeError"));
683 Handle<Code> code(isolate()->builtins()->builtin(builtin_name)); 683 Handle<Code> code(isolate()->builtins()->builtin(builtin_name));
684 Handle<JSFunction> function = 684 Handle<JSFunction> function =
685 factory()->NewFunctionWithoutPrototype(name, code); 685 factory()->NewFunctionWithoutPrototype(name, code);
686 function->set_map(native_context()->sloppy_function_map()); 686 function->set_map(native_context()->sloppy_function_map());
687 function->shared()->DontAdaptArguments(); 687 function->shared()->DontAdaptArguments();
688 688
689 // %ThrowTypeError% must not have a name property. 689 // %ThrowTypeError% must not have a name property.
690 JSReceiver::DeleteProperty(function, factory()->name_string()).Assert(); 690 if (JSReceiver::DeleteProperty(function, factory()->name_string())
691 .IsNothing())
692 DCHECK(false);
691 693
692 // length needs to be non configurable. 694 // length needs to be non configurable.
693 Handle<Object> value(Smi::FromInt(function->shared()->length()), isolate()); 695 Handle<Object> value(Smi::FromInt(function->shared()->length()), isolate());
694 JSObject::SetOwnPropertyIgnoreAttributes( 696 JSObject::SetOwnPropertyIgnoreAttributes(
695 function, factory()->length_string(), value, 697 function, factory()->length_string(), value,
696 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY)) 698 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY))
697 .Assert(); 699 .Assert();
698 700
699 if (JSObject::PreventExtensions(function, Object::THROW_ON_ERROR).IsNothing()) 701 if (JSObject::PreventExtensions(function, Object::THROW_ON_ERROR).IsNothing())
700 DCHECK(false); 702 DCHECK(false);
(...skipping 2557 matching lines...) Expand 10 before | Expand all | Expand 10 after
3258 } 3260 }
3259 3261
3260 3262
3261 // Called when the top-level V8 mutex is destroyed. 3263 // Called when the top-level V8 mutex is destroyed.
3262 void Bootstrapper::FreeThreadResources() { 3264 void Bootstrapper::FreeThreadResources() {
3263 DCHECK(!IsActive()); 3265 DCHECK(!IsActive());
3264 } 3266 }
3265 3267
3266 } // namespace internal 3268 } // namespace internal
3267 } // namespace v8 3269 } // namespace v8
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/builtins.cc » ('j') | test/mjsunit/harmony/proxies-delete-property.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698