There appears to be a bug in Ch. 2. I have entered the code as instructed for main.js, and it throws can error in Safari. Ot says I’m missing a semi-colon, but they appear to all be there:
My Code:
App.onLaunch = function(options) {
var resourceLoader = new ResourceLoaderJS(nativeResourceLoader.create());
var initialDoc = resourceLoader.getDocument(“hello.tvml”);
navigationDocument.pushDocument(initialDoc);
}
class ResourceLoaderJS {
constructor(nativeResourceLoader) {
this.nativeResourceLoader = nativeResourceLoader;
this.domParser = new DOMParser();
}
getDocument(name) {
var docString = this nativeResourceLoader.loadBundleResource(name);
return this.domParser.parseFromString(docString, "application/xml");
}
}
Safari Error:
SyntaxError: Unexpected identifier ‘nativeResourceLoader’. Expected ‘;’ after variable declaration.