Commit bd5e4b21 authored by Simon Zünd's avatar Simon Zünd Committed by V8 LUCI CQ

Add regression test to check Runtime.getProperties for native functions

We have a bug report from 2018 that no longer reproduces on ToT.
This CL adds a regression bug regardless to make sure we don't
re-introduce the bug that got fixed as a side-effect.

R=kimanh@chromium.org

Fixed: chromium:1246896
Change-Id: I8f9fdcbf7051b23e03cbbfc572771a410f70ad37
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3822668Reviewed-by: 's avatarKim-Anh Tran <kimanh@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82372}
parent 9aa28daa
Don't crash when getting the properties of a native function
{
internalProperties : [
[0] : {
name : [[Prototype]]
value : {
className : Function
description : function () { [native code] }
objectId : <objectId>
type : function
}
}
[1] : {
name : [[Scopes]]
value : {
className : Array
description : Scopes[0]
objectId : <objectId>
subtype : internal#scopeList
type : object
}
}
]
result : [
[0] : {
configurable : true
enumerable : false
isOwn : true
name : length
value : {
description : 2
type : number
value : 2
}
writable : false
}
[1] : {
configurable : true
enumerable : false
isOwn : true
name : name
value : {
type : string
value : slice
}
writable : false
}
]
}
// Copyright 2022 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
const {Protocol} = InspectorTest.start('Don\'t crash when getting the properties of a native function');
(async () => {
const { result: { result: {objectId } } } = await Protocol.Runtime.evaluate({
expression: '"".slice',
objectGroup: 'console',
includeCommandLineAPI: true,
});
const { result } = await Protocol.Runtime.getProperties({
objectId,
ownProperties: true,
accessorPropertiesOnly: false,
generatePreview: false,
});
InspectorTest.logMessage(result);
InspectorTest.completeTest();
})();
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