if (context == null) {
throw ScriptRuntime.constructError("Error",
"No context associated with current thread");
}
NativeObject json = (NativeObject) context.newObject(scope);
json.defineFunctionProperties(new String[] { "read", "write" },
JSON.class, ScriptableObject.PERMANENT);
return json;
}
}