Index: test/mjsunit/regress/regress-2156.js |
diff --git a/src/platform-posix.h b/test/mjsunit/regress/regress-2156.js |
similarity index 81% |
copy from src/platform-posix.h |
copy to test/mjsunit/regress/regress-2156.js |
index 7a982ed2ef3080dad77860d6f46b356a9067bf3b..348257113062b568770a072d86ed52b3e854d384 100644 |
--- a/src/platform-posix.h |
+++ b/test/mjsunit/regress/regress-2156.js |
@@ -25,15 +25,15 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-#ifndef V8_PLATFORM_POSIX_H_ |
-#define V8_PLATFORM_POSIX_H_ |
+// Flags: --allow-natives-syntax --harmony-collections |
-namespace v8 { |
-namespace internal { |
+var key1 = {}; |
+var key2 = {}; |
+var map = new WeakMap; |
-// Used by platform implementation files during OS::PostSetUp(). |
-void POSIXPostSetUp(); |
- |
-} } // namespace v8::internal |
- |
-#endif // V8_PLATFORM_POSIX_H_ |
+// Adding hidden properties preserves map sharing. Putting the key into |
+// a WeakMap will cause the first hidden property to be added. |
+assertTrue(%HaveSameMap(key1, key2)); |
+map.set(key1, 1); |
+map.set(key2, 2); |
+assertTrue(%HaveSameMap(key1, key2)); |