Interesting. In https://github.com/google/closure-compiler/wiki/Annotating-JavaScript-for-the-Closure-Compiler it mentions @const as the annotation. That might already work and if not, we should probably make it work.
The missing.js in royale-compiler is just there to get the compiler's tests to run. The royale-typedefs repo has a dependency on royale-compiler, so we can't create a circular dependency by having royale-compiler require royale-typedefs missing.js. They don't need to be kept in sync. The royale-compiler version should be minimal. The one in royale-typedefs is intended to make a library with the right and complete Browser APIs. HTH, -Alex On 6/29/18, 3:55 PM, "Frost, Andrew" <[email protected]> wrote: Hi Those date tests already test the mapping, and are running fine. They're not getting stuck at the earlier stage which is where the original problem lay. So I'd been thinking of adding a new test file under the below folder, where other AS-specific testing is happening: royale-compiler/compiler/src/test/java/as In terms of the read-only properties, I would have hoped that the definition in missing.js could be written: /** * @type {number} * @property * @readonly */ Date.prototype.timezoneOffset; but the JSDoc parser isn't able to pick up/report upon the 'property' or 'readonly' usage. We could add support for these perhaps, manually within the FieldReference.java file (which is where these properties are coming in currently) we could manually look for the "@property" and/or "@readonly" tags within the comment.getOriginalCommentString() value; I would have preferred to be able to call "comment.isReadOnly" or similar, but to get to that requires changing Google's code.. So yes, hold off doing anything with the pull requests for now, I'll see whether I can get it to do things from the typedefs side of things... One extra note: I'm finding two "missing.js" files which aren't being kept in sync at all (by the build tools); is this by design or should there be some kind of a link between them? royale-typedefs\js\src\main\javascript\missing.js royale-compiler\compiler-externc\src\test\resources\typedefs\unit_tests\missing.js thanks Andrew -----Original Message----- From: Alex Harui [mailto:[email protected]] Sent: 29 June 2018 17:38 To: [email protected] Subject: [EXTERNAL] Re: Royale compiler not handling Date.fullYear etc There are Date tests in TestRoyaleGlobalClasses.java In this case, the issue may be in how to set up a copy of the tests to work with js.swc instead of playerglobal.swc. Regarding read-only properties, I think the externc compiler might have a way of doing that. It would likely involve one of the JSDoc annotations or an interface. And the result should be a getter without a setter. I don't have time to look for it right now. It would be best to deal with this in the typedefs instead of in the compiler, IMO. My 2 cents, -Alex On 6/29/18, 7:47 AM, "Frost, Andrew" <[email protected]> wrote: ".. not yet" is probably the most appropriate response!! I had wondered whether it would need some formal self-tests adding, I'll have a dig around to see how to do this bit :-) thanks Andrew -----Original Message----- From: Harbs [mailto:[email protected]] Sent: 29 June 2018 13:35 To: [email protected] Subject: [EXTERNAL] Re: Royale compiler not handling Date.fullYear etc Cool. Are there compiler tests for these Date additions?
