improved native type handling for set operations

Modified: core.js
Modified: main.c
Modified: src/JSNative.c