From 1885a16551e78bd5ca36e292a121349791598751 Mon Sep 17 00:00:00 2001 From: pthier Date: Fri, 3 Feb 2023 11:41:50 +0100 Subject: [PATCH] [test][inspector] Add inspector test for RegExp v-flag Bug: v8:11935 Change-Id: Idf667b07398f3a740cc210ed52769199e9622e38 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4219017 Commit-Queue: Mathias Bynens Auto-Submit: Patrick Thier Reviewed-by: Mathias Bynens Cr-Commit-Position: refs/heads/main@{#85643} --- .../runtime/remote-object-expected.txt | 32 +++++++++++++++++++ test/inspector/runtime/remote-object.js | 11 +++++++ 2 files changed, 43 insertions(+) diff --git a/test/inspector/runtime/remote-object-expected.txt b/test/inspector/runtime/remote-object-expected.txt index 040c567cd5..765f8e26ef 100644 --- a/test/inspector/runtime/remote-object-expected.txt +++ b/test/inspector/runtime/remote-object-expected.txt @@ -484,6 +484,16 @@ Running test: testRegExp type : object } } +'/w+/v', returnByValue: false, generatePreview: false +{ + result : { + className : RegExp + description : /w+/v + objectId : + subtype : regexp + type : object + } +} '/w+/dgimsuy', returnByValue: false, generatePreview: false { result : { @@ -494,6 +504,16 @@ Running test: testRegExp type : object } } +'/w+/dgimsvy', returnByValue: false, generatePreview: false +{ + result : { + className : RegExp + description : /w+/dgimsvy + objectId : + subtype : regexp + type : object + } +} 'new RegExp('\w+', 'g')', returnByValue: false, generatePreview: false { result : { @@ -526,6 +546,18 @@ Running test: testRegExp type : object } } +'var re = /./dgimsvy; + re.toString = () => 'foo'; + re', returnByValue: false, generatePreview: false +{ + result : { + className : RegExp + description : /./dgimsvy + objectId : + subtype : regexp + type : object + } +} 'var re = new RegExp('\w+', 'g'); re.prop = 32; re', returnByValue: false, generatePreview: true diff --git a/test/inspector/runtime/remote-object.js b/test/inspector/runtime/remote-object.js index d50d7aa0a5..ed4e764e43 100644 --- a/test/inspector/runtime/remote-object.js +++ b/test/inspector/runtime/remote-object.js @@ -234,9 +234,15 @@ InspectorTest.runAsyncTestSuite([ InspectorTest.logMessage((await evaluate({ expression: '/\w+/y' })).result); + InspectorTest.logMessage((await evaluate({ + expression: '/\w+/v' + })).result); InspectorTest.logMessage((await evaluate({ expression: '/\w+/dgimsuy' })).result); + InspectorTest.logMessage((await evaluate({ + expression: '/\w+/dgimsvy' + })).result); InspectorTest.logMessage((await evaluate({ expression: `new RegExp('\\w+', 'g')`, })).result); @@ -248,6 +254,11 @@ InspectorTest.runAsyncTestSuite([ re.toString = () => 'foo'; re` })).result); + InspectorTest.logMessage((await evaluate({ + expression: `var re = /./dgimsvy; + re.toString = () => 'foo'; + re` + })).result); InspectorTest.logMessage((await evaluate({ expression: `var re = new RegExp('\\w+', 'g'); re.prop = 32;