1

I need to store an Australian domain as a string. Australian domains end with ".com.au"

Google Scripts seems to be displaying all instances of ".com.au" with "(class)".

To reproduce, create a basic function in Google Apps Scripts as follows:

function myFunction() {
  var x = "com.au";
  console.log("x: " + x);
  var z = 1;   //<--create break point here
}

Create a breakpoint at var z = 1, and then debug the script.

Actual Results:

In the console (at breakpoint):

x: (class)

Expected Results:

x: "com.au"

*Note: upon further testing, from a practical perspective, "(class)" seems to still be treated as "com.au" so this is not a blocker to use, but it is odd and does not help when debugging.

6
  • Do you get that same issue if you are parsing input, e.g. if cell A1 on a Google Sheet is com.au, do you get this same behavior when you read cell A1 into a variable? Commented Sep 8, 2018 at 1:52
  • @tehhowch, yes, same behavior. Commented Sep 8, 2018 at 2:05
  • And same from a Ui prompt / Browser inputBox? Commented Sep 8, 2018 at 3:20
  • @Rubén, I investigated further and it the string change is only cosmetic, and from a practical application, doesn't change the end result. I added more detailed steps to replicate regardless. Commented Sep 8, 2018 at 5:00
  • 1
    I suppose that's how the JS code parser in the Google Script Editor is written. There isn't much you can do about it other than reporting it to Google as an issue. Commented Sep 8, 2018 at 15:49

3 Answers 3

2

This issue was reported as a bug to Google: https://issuetracker.google.com/issues/114358543

Sign up to request clarification or add additional context in comments.

Comments

1

This looks to be a bug of the Google Apps Script editor debugger that should be reported to Google. Please follow the directions on https://developers.google.com/apps-script/support#bugs.

1 Comment

Yep, already done. issuetracker.google.com/issues/114358543. Thank you for confirming.
0

I just got around this bug with the use of an Array.

function myFunction() {
  var array = new Array();
  var text ="[email protected]";
  array[0] = string; 
}

text returns email@email.(class)

array[0] returns [email protected]

1 Comment

var text but = string?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.