v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
builtins-collections.cc
Go to the documentation of this file.
1// Copyright 2016 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
10
11namespace v8 {
12namespace internal {
13
14BUILTIN(MapPrototypeClear) {
15 HandleScope scope(isolate);
16 const char* const kMethodName = "Map.prototype.clear";
17 CHECK_RECEIVER(JSMap, map, kMethodName);
18 JSMap::Clear(isolate, map);
19 return ReadOnlyRoots(isolate).undefined_value();
20}
21
22BUILTIN(SetPrototypeClear) {
23 HandleScope scope(isolate);
24 const char* const kMethodName = "Set.prototype.clear";
25 CHECK_RECEIVER(JSSet, set, kMethodName);
26 JSSet::Clear(isolate, set);
27 return ReadOnlyRoots(isolate).undefined_value();
28}
29
30} // namespace internal
31} // namespace v8
#define CHECK_RECEIVER(Type, name, method)
#define BUILTIN(name)
static void Clear(Isolate *isolate, DirectHandle< JSMap > map)
Definition objects.cc:6294
static void Clear(Isolate *isolate, DirectHandle< JSSet > set)
Definition objects.cc:6276