summaryrefslogtreecommitdiff
path: root/external/contributions/Google/sputnik_conformance_modified/08_Types/8.7_The_Reference_Type/S8.7_A3.js
diff options
context:
space:
mode:
Diffstat (limited to 'external/contributions/Google/sputnik_conformance_modified/08_Types/8.7_The_Reference_Type/S8.7_A3.js')
-rw-r--r--external/contributions/Google/sputnik_conformance_modified/08_Types/8.7_The_Reference_Type/S8.7_A3.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/external/contributions/Google/sputnik_conformance_modified/08_Types/8.7_The_Reference_Type/S8.7_A3.js b/external/contributions/Google/sputnik_conformance_modified/08_Types/8.7_The_Reference_Type/S8.7_A3.js
new file mode 100644
index 000000000..bcecbfc76
--- /dev/null
+++ b/external/contributions/Google/sputnik_conformance_modified/08_Types/8.7_The_Reference_Type/S8.7_A3.js
@@ -0,0 +1,28 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+* @name: S8.7_A3;
+* @section: 8.7;
+* @assertion: Changing the Reference of an Object While Maintaining Integrity;
+* @description: Create a reference to the array, and redefine original array with new array;
+*/
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#
+// Set items to an array (object) of strings
+var items = new Array( "one", "two", "three" );
+// Set itemsRef to a reference to items
+//
+var itemsRef = items;
+// Set items to equal a new object
+//
+items = new Array( "new", "array" );
+// items and itemsRef now point to different objects.
+// items points to new Array( "new", "array" )
+// itemsRef points to new Array( "one", "two", "three" )
+if( items == itemsRef ){
+ $ERROR('#1: var items = new Array( "one", "two", "three" ); var itemsRef = items; items = new Array( "new", "array" ); items != itemsRef');
+};
+//
+//////////////////////////////////////////////////////////////////////////////