JXA date formatter option not working in High Sierra

I've got a JXA script action running on my Catalina machine that works just fine. On my High Sierra machine, however, it doesn't work at all and I can't figure out why.

Here's the script:

(() => {
	'use strict'
	
    const dt = $.NSISO8601DateFormatter.alloc.init
	dt.formatOptions = $.NSISO8601DateFormatWithFullDate
	//I also tried setFormatOptions after my AS code below worked in HS
	//...it didn't work
	console.log( dt.stringFromDate(new Date()).js )
		
})();

The error occurs on line 5, where I set dt.formatOptions and this is the error message:

2020-01-31 22:54:26.632 osascript[9648:49921797] *** Assertion failure in -[NSISO8601DateFormatter setFormatOptions:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/Foundation/Foundation-1454.90/Foundation/String.subproj/NSISO8601DateFormatter.m:66
Untitled.js:76:129: execution error: Error on line 5: Error: exception raised by object: Invalid parameter not satisfying: formatOptions == 0 || !(formatOptions & ~(NSISO8601DateFormatWithYear | NSISO8601DateFormatWithMonth | NSISO8601DateFormatWithWeekOfYear | NSISO8601DateFormatWithDay | NSISO8601DateFormatWithTime | NSISO8601DateFormatWithTimeZone | NSISO8601DateFormatWithSpaceBetweenDateAndTime | NSISO8601DateFormatWithDashSeparatorInDate | NSISO8601DateFormatWithColonSeparatorInTime | NSISO8601DateFormatWithColonSeparatorInTimeZone | NSISO8601DateFormatWithFractionalSeconds | NSISO8601DateFormatWithFullDate | NSISO8601DateFormatWithFullTime | NSISO8601DateFormatWithInternetDateTime)) (-2700)

I then tried this:

(() => {
	'use strict'
	
    const
		saveDate = $.NSISO8601DateFormatter.stringFromDateTimeZoneFormatOptions(
						new Date(), 
						$.NSTimeZone.timeZoneWithAbbreviation("PST"), 
						$.NSISO8601DateFormatWithFullDate).js
	console.log( saveDate )
		
})();

But I got the same error.

Both of these work 100% perfectly on Catalina, returning a string like 2020-01-31.

According to Apple's docs for NSISO8601DateFormatter, everything in this script is available on macOS 10.12+ so I should be good on that front.

I know there are other ways of getting this formatted date string, but I'm hoping to figure out why this one won't work on High Sierra, if only to satisfy my own curiosity.

Oh, and just for the hell of it, I tried this AppleScript on my HS machine and it worked!

use AppleScript version "2.5"
use framework "Foundation"
use scripting additions

set dt to current application's NSISO8601DateFormatter's new()
dt's setFormatOptions:(current application's NSISO8601DateFormatWithFullDate)
log (dt's stringFromDate:(current date)) as string

You would likely get more help by posting your question at stackoverflow.com.

If you need to format a date using KM, then try using ICUDateTime token.
You could even call this token from JXA using the Keyboard Maestro Engine.