Instance Scan Linter Check Rhino Error

Shin Imai
Tera Contributor

I'm trying to create a linter check to scan for client scripts on a fresh Australia PDI but am always getting the following Failure.

Rhino error: missing ; before statement

 

I've stripped the linter check script to a barebones version to see if I still get the failure, and I do.

(function (engine) {
	var TABLES_TO_CHECK = ["sys_script_client"];
	if (TABLES_TO_CHECK.indexOf(String(engine.current.getTableName())) == -1) {
		return;
	}

	gs.info(new GlideDateTime().getNumericValue() + " Current script being checked: " + engine.current.getValue("name") + " " + engine.current.sys_id);

})(engine);

 

Is there a way to print a stack trace to see what segment of code is causing this error?

ShinImai_0-1780472655078.png

 

2 REPLIES 2

Mark Roethof
Tera Patron

Hi there,

 

Don't see any error in the code visually, will try to reproduce on a PDI.

 

Is this just a test or what are you after with your check? Asking because seeing the tables_to_check, this is a very inefficient use of Instance Scan, since Linter Check will still run on every table with script fields. So instead of a table check that would run in a few seconds, this linter check will run for several minutes on larger instances or even time-out.

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Mark Roethof
Tera Patron

Just did a copy/past of your code, scan: no error.

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn