-
Notifications
You must be signed in to change notification settings - Fork 0
Overspecification in JSCert - messages in native errors #14
Comments
Hi, We chose to drop implementation-defined parts. Arthur
|
This makes JSCert less useful for other projects, such as the one I am doing. I'm now trying to prove S5 (the current version of lambdajs) correct with respect to JSCert, and this issue means either I leave some parts unproven, or I need to change S5 to follow the implementation decisions of JSRef. I'm now confused about the philosophy of JSCert. I thought JSCert was supposed to be the formalized specification (and therefore only specify what is actually specified in the spec), and JSRef should be the runnable implementation (and therefore specify things left unspecified in JSCert). Was I wrong? I'm confused about the functor idea. JSCert is presented as a predicate, and can therefore be non-deterministic in places where an implementation-dependent behavior can occur. Is this a bad idea for some reason? |
Non-deterministic and implementation-dependent are two different things. For example, you can have an implementation-dependent feature that has a This is why JSCert should be parametric in the implementation-dependent Does this help somehow?
|
Thank you for the helpful response. In this case, I think I will for now ignore the problem and document the places where I had to do that. |
Hi, I understand this idea of functors, but I have to admit that before In a non-completely related matter, does someone know the difference Martin. |
How about allowing any string or undefined? | red_spec_error : forall S C ne m s o1 o,
(m = undef \/ m = prim_string s) ->
red_expr S C (spec_build_error (prealloc_native_error_proto ne) m) o1 ->
red_expr S C (spec_error_1 o1) o ->
red_expr S C (spec_error ne) o |
This would solve my issue, however it does introduce nondeterminism to the predicate. |
On 2015-05-22 16:48, Marek Materzok [email protected] writes:
Yes, which is one way to deal with implementation dependent matter. An Alan OpenPGP Key ID : 040D0A3B4ED2E5C7 |
A closer reading of the standard for NativeErrors is leaving me unsettled:
My reading of this is that it throws the exact object as defined below (i.e. the constructor), this directly contradicts 15.11.7, which states that an instance should be thrown. And to get back onto topic, the rest of 15.11.7 reads (emphasis mine)
NativeErrors are not defined to have a
Following this pattern, 15.11.7 says that NativeError.prototype.message is implementation-dependent.
I believe the intent of the specification to be that the Thoughts? |
The first of these issues has been corrected in ES6. |
I would bring up such issues (the ones still present in ES6) on the es-discuss list. Are you subscribed? |
I am subscribed, will take a brief look through test262 to see if I can find anything to support this before writing something along the lines of above. |
It looks like the text in the spec is a hang-over from a change between ES3 and ES5, the text of 15.11.7.10 NativeError.prototype.message in ES3 is:
I'll report this directly to the ECMAScript bugtracker, since this appears to be the cause of the error. |
@edgemaster : I have a bugzilla account. Should I report it there (based on your email)? I’ll also ask Allen if he thinks it’s a bug. |
Bug filed at https://bugs.ecmascript.org/show_bug.cgi?id=4430 |
Currently JSCert specifies that errors thrown with spec_error must have no message (rule red_spec_error).
But ES5 says that native errors have implementation-defined messages (15.11.7).
The text was updated successfully, but these errors were encountered: