[api] Mark SetHiddenPrototype as DEPRECATED

Change-Id: Iad53e1a3b6ef0148dc5aa9c5c04c25c446dcdfa2
Reviewed-on: https://chromium-review.googlesource.com/c/1460468
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59464}
This commit is contained in:
Toon Verwaest 2019-02-08 11:46:49 +01:00 committed by Commit Bot
parent 37e632b119
commit b9af6ad89d
5 changed files with 23 additions and 926 deletions

View File

@ -6022,7 +6022,8 @@ class V8_EXPORT FunctionTemplate : public Template {
* function template. By default, instances of a function template
* 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

View File

@ -1016,6 +1016,7 @@ DEFINE_IMPLICATION(trace_maps, log_code)
// parser.cc
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
DEFINE_BOOL(trace_sim, false, "Trace simulator execution")

File diff suppressed because it is too large Load Diff

View File

@ -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 {
public:
SimpleContext()

View File

@ -28,8 +28,6 @@ TEST(Unscopables) {
v8::Local<v8::FunctionTemplate> t0 = 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)
.ToLocalChecked()
->NewInstance(current_context)