undefined and null can be modified


The following code:

var x;
x.a = "b";

succeeds in Jint but should fail with something like:
"Unable to set value of the property 'a': object is null or undefined"

ECMAScript doesn't allow you to do this.

I added the following to Jint.Native.JsUndefined:
    public override void DefineOwnProperty(Descriptor currentDescriptor) {
        throw new JintException(String.Format("Unable to define property '{0}': object is undefined", currentDescriptor.Name));
and a similar exception for the same method in Jint.Native.JsNull.
Closed Oct 3, 2014 at 6:43 PM by sebastienros
Jint has been rewritten and this issue should be fixed in the new version. Please check it on https://github.com/sebastienros/jint or on using the nuget package here: https://www.nuget.org/packages/Jint/