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

Side by Side Diff: src/runtime/runtime-classes.cc

Issue 896643003: Class methods should be non enumerable (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: formatting Created 5 years, 10 months 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 <stdlib.h> 5 #include <stdlib.h>
6 #include <limits> 6 #include <limits>
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/isolate-inl.h" 10 #include "src/isolate-inl.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 RUNTIME_FUNCTION(Runtime_DefineClassMethod) { 152 RUNTIME_FUNCTION(Runtime_DefineClassMethod) {
153 HandleScope scope(isolate); 153 HandleScope scope(isolate);
154 DCHECK(args.length() == 3); 154 DCHECK(args.length() == 3);
155 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0); 155 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0);
156 CONVERT_ARG_HANDLE_CHECKED(Name, name, 1); 156 CONVERT_ARG_HANDLE_CHECKED(Name, name, 1);
157 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 2); 157 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 2);
158 158
159 uint32_t index; 159 uint32_t index;
160 if (name->AsArrayIndex(&index)) { 160 if (name->AsArrayIndex(&index)) {
161 RETURN_FAILURE_ON_EXCEPTION( 161 RETURN_FAILURE_ON_EXCEPTION(
162 isolate, JSObject::SetOwnElement(object, index, function, STRICT)); 162 isolate,
163 JSObject::SetOwnElement(object, index, function, DONT_ENUM, STRICT));
163 } else { 164 } else {
164 RETURN_FAILURE_ON_EXCEPTION( 165 RETURN_FAILURE_ON_EXCEPTION(
165 isolate, 166 isolate, JSObject::SetOwnPropertyIgnoreAttributes(object, name,
166 JSObject::SetOwnPropertyIgnoreAttributes(object, name, function, NONE)); 167 function, DONT_ENUM));
167 } 168 }
168 return isolate->heap()->undefined_value(); 169 return isolate->heap()->undefined_value();
169 } 170 }
170 171
171 172
172 RUNTIME_FUNCTION(Runtime_ClassGetSourceCode) { 173 RUNTIME_FUNCTION(Runtime_ClassGetSourceCode) {
173 HandleScope shs(isolate); 174 HandleScope shs(isolate);
174 DCHECK(args.length() == 1); 175 DCHECK(args.length() == 1);
175 CONVERT_ARG_HANDLE_CHECKED(JSFunction, fun, 0); 176 CONVERT_ARG_HANDLE_CHECKED(JSFunction, fun, 0);
176 177
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 } 436 }
436 437
437 Handle<Object> result; 438 Handle<Object> result;
438 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 439 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
439 isolate, result, 440 isolate, result,
440 Execution::Call(isolate, proto_function, receiver, argc, argv, false)); 441 Execution::Call(isolate, proto_function, receiver, argc, argv, false));
441 return *result; 442 return *result;
442 } 443 }
443 } 444 }
444 } // namespace v8::internal 445 } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698