EnumPopup in Javascript?

How do I do this (without also adding #pragma downcast):

#pragma strict

enum Op { Foo, Bar }
op = EditorGUILayout.EnumPopup("Operator: ", op);

(gives error BCE0022: Cannot convert 'System.Enum' to 'Op')

In C#, I could:

op = (Op)EditorGUILayout.EnumPopup("Operator: ", op);

But what is the equivalent for JS?

If pragma strict is now enforced on iOS (I wish it was on all platforms), it seems that much of the documentation examples would not work (my code above is as-per the EnumPopup docs). I find it a bit annoying that the documentation often shows how to do stuff, but with code that only works without #pragma strict (for loops and non-generic GetComponent() being the worst).

Best I’ve come up with is:

op = System.Convert.ToInt32(EditorGUILayout.EnumPopup(op));

Which is too ugly to accept this as the answer.

I believe casting is done with the “as” operator in javascript. So it would go like this:

op = EditorGUILayout.EnumPopup("Operator: ", op) as OP;