Commit b9af6ad8 authored by Toon Verwaest's avatar Toon Verwaest Committed by Commit Bot

[api] Mark SetHiddenPrototype as DEPRECATED

Change-Id: Iad53e1a3b6ef0148dc5aa9c5c04c25c446dcdfa2
Reviewed-on: https://chromium-review.googlesource.com/c/1460468Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59464}
parent 37e632b1
...@@ -6022,7 +6022,8 @@ class V8_EXPORT FunctionTemplate : public Template { ...@@ -6022,7 +6022,8 @@ class V8_EXPORT FunctionTemplate : public Template {
* function template. By default, instances of a function template * function template. By default, instances of a function template
* are not ignored. * are not ignored.
*/ */
void SetHiddenPrototype(bool value); V8_DEPRECATED("This feature is incompatible with ES6+.",
void SetHiddenPrototype(bool value));
/** /**
* Sets the ReadOnly flag in the attributes of the 'prototype' property * Sets the ReadOnly flag in the attributes of the 'prototype' property
......
...@@ -1016,6 +1016,7 @@ DEFINE_IMPLICATION(trace_maps, log_code) ...@@ -1016,6 +1016,7 @@ DEFINE_IMPLICATION(trace_maps, log_code)
// parser.cc // parser.cc
DEFINE_BOOL(allow_natives_syntax, false, "allow natives syntax") DEFINE_BOOL(allow_natives_syntax, false, "allow natives syntax")
DEFINE_BOOL(preparse, false, "only preparse the input")
// simulator-arm.cc, simulator-arm64.cc and simulator-mips.cc // simulator-arm.cc, simulator-arm64.cc and simulator-mips.cc
DEFINE_BOOL(trace_sim, false, "Trace simulator execution") DEFINE_BOOL(trace_sim, false, "Trace simulator execution")
......
This diff is collapsed.
...@@ -427,61 +427,6 @@ TEST(AbsentInPrototype) { ...@@ -427,61 +427,6 @@ TEST(AbsentInPrototype) {
class ExistsInHiddenPrototypeContext: public DeclarationContext {
public:
ExistsInHiddenPrototypeContext() {
hidden_proto_ = FunctionTemplate::New(CcTest::isolate());
hidden_proto_->SetHiddenPrototype(true);
}
protected:
v8::Local<Integer> Query(Local<Name> key) override {
// Let it seem that the property exists in the hidden prototype object.
return Integer::New(isolate(), v8::None);
}
// Install the hidden prototype after the global object has been created.
void PostInitializeContext(Local<Context> context) override {
Local<Object> global_object = context->Global();
Local<Object> hidden_proto = hidden_proto_->GetFunction(context)
.ToLocalChecked()
->NewInstance(context)
.ToLocalChecked();
Local<Object> inner_global =
Local<Object>::Cast(global_object->GetPrototype());
inner_global->SetPrototype(context, hidden_proto).FromJust();
}
// Use the hidden prototype as the holder for the interceptors.
Local<ObjectTemplate> GetHolder(Local<FunctionTemplate> function) override {
return hidden_proto_->InstanceTemplate();
}
private:
Local<FunctionTemplate> hidden_proto_;
};
TEST(ExistsInHiddenPrototype) {
HandleScope scope(CcTest::isolate());
{ ExistsInHiddenPrototypeContext context;
context.Check("var x; x", 0, 0, 0, EXPECT_RESULT,
Undefined(CcTest::isolate()));
}
{ ExistsInHiddenPrototypeContext context;
context.Check("var x = 0; x", 0, 0, 0, EXPECT_RESULT,
Number::New(CcTest::isolate(), 0));
}
{ ExistsInHiddenPrototypeContext context;
context.Check("function x() { }; x", 0, 1, 1, EXPECT_RESULT);
}
}
class SimpleContext { class SimpleContext {
public: public:
SimpleContext() SimpleContext()
......
...@@ -28,8 +28,6 @@ TEST(Unscopables) { ...@@ -28,8 +28,6 @@ TEST(Unscopables) {
v8::Local<v8::FunctionTemplate> t0 = v8::FunctionTemplate::New(isolate); v8::Local<v8::FunctionTemplate> t0 = v8::FunctionTemplate::New(isolate);
v8::Local<v8::FunctionTemplate> t1 = v8::FunctionTemplate::New(isolate); v8::Local<v8::FunctionTemplate> t1 = v8::FunctionTemplate::New(isolate);
t1->SetHiddenPrototype(true);
v8::Local<v8::Object> object = t0->GetFunction(current_context) v8::Local<v8::Object> object = t0->GetFunction(current_context)
.ToLocalChecked() .ToLocalChecked()
->NewInstance(current_context) ->NewInstance(current_context)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment