Index: test/mjsunit/object-literal.js |
diff --git a/test/mjsunit/object-literal.js b/test/mjsunit/object-literal.js |
index b861d443c0cd0bc011bfcadc20e9a963f608fcd9..5769af8f4b716ff2c19f0d0b1426a9a29081558b 100644 |
--- a/test/mjsunit/object-literal.js |
+++ b/test/mjsunit/object-literal.js |
@@ -260,3 +260,18 @@ TestNumericNamesSetter(['1.2', '1.3'], { |
set 1.2(_) {; }, |
set 1.30(_) {; } |
}); |
+ |
+ |
+(function TestLiteralWithNullProto() { |
+ // Assume dictionary usage for simple null prototype literal objects, |
+ // this is equivalent to Object.create(null). |
+ var obj = {__proto__:null}; |
+ assertFalse(%HasFastProperties(obj)); |
adamk
2016/10/25 11:14:24
You'll need --allow-natives-syntax in Flags
Camillo Bruni
2017/03/13 17:21:44
arg, bitten by my own smart aliases that add these
|
+ assertEquals(Object.getPrototypeOf(obj), null); |
+ // Once we add inline properties we probably don't want slow properties |
+ // anymore. |
+ var obj2 = {__proto__:null, a:1, b:2}; |
adamk
2016/10/25 11:14:24
Please add a test with computed properties and non
Camillo Bruni
2017/03/13 17:21:44
done.
|
+ assertTrue(%HasFastProperties(obj2)); |
+ assertEquals(Object.getPrototypeOf(obj2), null); |
+ |
+})() |