Here is a small test case:
function applyMask(inputObj, mask) {
var outputObj = Object.create(mask),
maskKeys = Object.keys(mask);
for (var j = 0; j < maskKeys.length; ++j) {
var key = maskKeys[j];
outputObj[key] = inputObj[key];
}
return outputObj;
}
var testMask = {
"key0": null,
"key1": null,
"key2": null,
"key3": null,
"key4": null,
"key5": null,
"key6": null,
"key7": null,
"key8": null,
"key9": null,
"key10": null,
"key11": null,
"key12": null,
"key13": null,
"key14": null
,"key15": null
,"key16": null
,"key17": null
,"key18": null
,"key19": null
};
var testObj = {
"otherProp": "blah blah blah",
"key0": "value",
"key1": "value"
};
var outputObj = applyMask(testObj, testMask);
alert(%HasFastProperties(outputObj));
If I comment out lines "key15" through "key19" within the definition of testMask, then outputObj is in fast properties mode, but as is, the alert dialog says false because outputObj is in hash table mode.
I am using Chrome 35.0.1916.153 with v8 3.25.28.18.