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/+/3822668 Reviewed-by: Kim-Anh Tran <kimanh@chromium.org> Commit-Queue: Simon Zünd <szuend@chromium.org> Cr-Commit-Position: refs/heads/main@{#82372}
This commit is contained in:
parent
9aa28daafe
commit
bd5e4b215c
49
test/inspector/regress/regress-crbug-1246896-expected.txt
Normal file
49
test/inspector/regress/regress-crbug-1246896-expected.txt
Normal file
@ -0,0 +1,49 @@
|
||||
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
|
||||
}
|
||||
]
|
||||
}
|
23
test/inspector/regress/regress-crbug-1246896.js
Normal file
23
test/inspector/regress/regress-crbug-1246896.js
Normal file
@ -0,0 +1,23 @@
|
||||
// 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();
|
||||
})();
|
Loading…
Reference in New Issue
Block a user