provegard / ncdbg

A debugger for Nashorn that uses Chrome DevTools as frontend
BSD 3-Clause "New" or "Revised" License
31 stars 5 forks source link

Getting error when performing property extraction #68

Closed JayBerlin closed 6 years ago

JayBerlin commented 6 years ago

I am running the latest version of NCDbg and I am getting the following error on the Chrome console when trying to get Object property values:

Error: 'Error from object property extraction: jdk.nashorn.internal.runtime.ECMAException: SyntaxError: :8:40 Expected { but found blacklistRegExp var includeProp = function (prop) blacklistRegExp ? !prop.match(blacklistRegExp) : true ^ at data (ui://lz.ui-330d03986d154714bf108bef399b4357/components/lz_csi_list_filter/LzCSIListFilterServer.js:18) at ajax_getFilters (ui://lz.ui-330d03986d154714bf108bef399b4357/components/lz_csi_list_filter/LzCSIListFilterServer.js:34)' for object '{"id":"$$locals-ndsf1"}'

This is coming from PropertyHolder.scala:153:

  var includeProp = function (prop) (blacklistRegExp ? !prop.match(blacklistRegExp) : true)

If I change the above line to the following, things work properly and I can see all of my Local variable again:

  var includeProp = function (prop) { return (blacklistRegExp ? !prop.match(blacklistRegExp) : true) }
provegard commented 6 years ago

Good catch, that syntax is a Nashorn extension. I assume you have those turned off?

JayBerlin commented 6 years ago

We do. There are reasons that we do not allow the extensions at this time.

provegard commented 6 years ago

Sure, no problem. I'll have a fix up in a few minutes.

provegard commented 6 years ago

Fixed. Let me know if you run into anything else! Thanks for reporting! :-)

JayBerlin commented 6 years ago

Thanks! Really like this project. It is exactly what we were looking for. Will report anything else we run into, but so far, things have been working!

provegard commented 6 years ago

Thanks, good to hear! :-)