Merge m-i to m-c
authorPhil Ringnalda <philringnalda@gmail.com>
Mon, 24 Jun 2013 21:54:17 -0700
changeset 136349 bc569033125a0dd09bd0d66fa8bb8498c04c15c0
parent 136348 a47f79f7192d0ba15a52245abe2efb13fe9ae122 (current diff)
parent 136339 6e091ce775ef358ff4dbadb162ddc807350bd210 (diff)
child 136350 c869e5d3ea1c9f7b4ae9c9bd2cbf880a84fd07ac
child 136415 ded36e16ca3984f192f6743f36651fcdc5e2b580
child 136561 83e5f507582c84fbfbbc93898de602956213d9be
push id30050
push userphilringnalda@gmail.com
push dateTue, 25 Jun 2013 04:56:34 +0000
treeherdermozilla-inbound@c869e5d3ea1c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone25.0a1
first release with
nightly linux32
bc569033125a / 25.0a1 / 20130625031238 / files
nightly linux64
bc569033125a / 25.0a1 / 20130625031238 / files
nightly mac
bc569033125a / 25.0a1 / 20130625031238 / files
nightly win32
bc569033125a / 25.0a1 / 20130625031238 / files
nightly win64
bc569033125a / 25.0a1 / 20130625031238 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge m-i to m-c
dom/interfaces/svg/nsIDOMSVGAnimatedLength.idl
mobile/android/base/braille/com/googlecode/eyesfree/braille/selfbraille/ISelfBrailleService.aidl
mobile/android/base/braille/com/googlecode/eyesfree/braille/selfbraille/WriteData.aidl
--- a/b2g/app/b2g.js
+++ b/b2g/app/b2g.js
@@ -551,20 +551,23 @@ pref("dom.experimental_forms", true);
 pref("gfx.gralloc.enabled", false);
 
 // XXXX REMOVE FOR PRODUCTION. Turns on GC and CC logging
 pref("javascript.options.mem.log", false);
 
 // Increase mark slice time from 10ms to 30ms
 pref("javascript.options.mem.gc_incremental_slice_ms", 30);
 
-pref("javascript.options.mem.gc_high_frequency_heap_growth_max", 150);
+// Increase time to get more high frequency GC on benchmarks from 1000ms to 1500ms
+pref("javascript.options.mem.gc_high_frequency_time_limit_ms", 1500);
+
+pref("javascript.options.mem.gc_high_frequency_heap_growth_max", 300);
 pref("javascript.options.mem.gc_high_frequency_heap_growth_min", 120);
 pref("javascript.options.mem.gc_high_frequency_high_limit_mb", 40);
-pref("javascript.options.mem.gc_high_frequency_low_limit_mb", 10);
+pref("javascript.options.mem.gc_high_frequency_low_limit_mb", 0);
 pref("javascript.options.mem.gc_low_frequency_heap_growth", 120);
 pref("javascript.options.mem.high_water_mark", 6);
 pref("javascript.options.mem.gc_allocation_threshold_mb", 1);
 pref("javascript.options.mem.gc_decommit_threshold_mb", 1);
 
 // Show/Hide scrollbars when active/inactive
 pref("ui.showHideScrollbars", 1);
 
--- a/browser/metro/theme/browser.css
+++ b/browser/metro/theme/browser.css
@@ -279,17 +279,17 @@ documenttab[selected] .documenttab-selec
   #toolbar > #back-button {
     list-style-image: url(chrome://browser/skin/images/appbar-back@1.4x.png);
   }
 
   #toolbar > #forward-button {
     list-style-image: url(chrome://browser/skin/images/appbar-forward@1.4x.png);
   }
 }
-+
+
 /* URL bar */
 #urlbar-container {
   border: @metro_border_thick@ solid @urlbar_border_color@;
   margin: 0 @toolbar_horizontal_spacing@;
   padding: 0;
   background-color: @field_background_color@;
   overflow: hidden;
 }
--- a/client.py
+++ b/client.py
@@ -90,16 +90,41 @@ def toggle_trailing_blank_line(depname):
 
   if not lines[-1].strip():
       # trailing line is blank, removing it
       open(depname, "wb").writelines(lines[:-1])
   else:
       # adding blank line
       open(depname, "ab").write("\n")
 
+def get_trailing_blank_line_state(depname):
+  lines = open(depname, "r").readlines()
+  if not lines:
+      print >>sys.stderr, "unexpected short file"
+      return "no blank line"
+
+  if not lines[-1].strip():
+      return "has blank line"
+  else:
+      return "no blank line"
+
+def update_nspr_or_nss(tag, depfile, destination, hgpath):
+  print "reverting to HG version of %s to get its blank line state" % depfile
+  check_call_noisy([options.hg, 'revert', depfile])
+  old_state = get_trailing_blank_line_state(depfile)
+  print "old state of %s is: %s" % (depfile, old_state)
+  do_hg_replace(destination, hgpath, tag, HG_EXCLUSIONS, options.hg)
+  new_state = get_trailing_blank_line_state(depfile)
+  print "new state of %s is: %s" % (depfile, new_state)
+  if old_state == new_state:
+    print "toggling blank line in: ", depfile
+    toggle_trailing_blank_line(depfile)
+  tag_file = destination + "/TAG-INFO"
+  print >>file(tag_file, "w"), tag
+
 o = OptionParser(usage="client.py [options] update_nspr tagname | update_nss tagname | update_libffi tagname | update_webidlparser tagname")
 o.add_option("--skip-mozilla", dest="skip_mozilla",
              action="store_true", default=False,
              help="Obsolete")
 
 o.add_option("--cvs", dest="cvs", default=os.environ.get('CVS', 'cvs'),
              help="The location of the cvs binary")
 o.add_option("--cvsroot", dest="cvsroot",
@@ -114,26 +139,22 @@ except IndexError:
     o.print_help()
     sys.exit(2)
 
 if action in ('checkout', 'co'):
     print >>sys.stderr, "Warning: client.py checkout is obsolete."
     pass
 elif action in ('update_nspr'):
     tag, = args[1:]
-    do_hg_replace('nsprpub', 'https://hg.mozilla.org/projects/nspr',
-	              tag, HG_EXCLUSIONS, options.hg)
-    print >>file("nsprpub/TAG-INFO", "w"), tag
-    toggle_trailing_blank_line("nsprpub/config/prdepend.h")
+    depfile = "nsprpub/config/prdepend.h"
+    update_nspr_or_nss(tag, depfile, 'nsprpub', 'https://hg.mozilla.org/projects/nspr')
 elif action in ('update_nss'):
     tag, = args[1:]
-    do_hg_replace('security/nss', 'https://hg.mozilla.org/projects/nss',
-	              tag, HG_EXCLUSIONS, options.hg)
-    print >>file("security/nss/TAG-INFO", "w"), tag
-    toggle_trailing_blank_line("security/nss/coreconf/coreconf.dep")
+    depfile = "security/nss/coreconf/coreconf.dep"
+    update_nspr_or_nss(tag, depfile, 'security/nss', 'https://hg.mozilla.org/projects/nss')
 elif action in ('update_libffi'):
     tag, = args[1:]
     if not options.cvsroot:
         options.cvsroot = CVSROOT_LIBFFI
     do_cvs_export(LIBFFI_DIRS, tag, options.cvsroot, options.cvs)
 elif action in ('update_webidlparser'):
     tag, = args[1:]
     do_hg_replace(WEBIDLPARSER_DIR, WEBIDLPARSER_REPO, tag, WEBIDLPARSER_EXCLUSIONS, options.hg)
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -1177,33 +1177,24 @@ ifeq ($(OS_ARCH),OS2)
 else
 ifdef GNU_CC
 	$(RC) $(RCFLAGS) $(filter-out -U%,$(DEFINES)) $(INCLUDES:-I%=--include-dir %) $(OUTOPTION)$@ $(_VPATH_SRCS)
 else
 	$(RC) $(RCFLAGS) -r $(DEFINES) $(INCLUDES) $(OUTOPTION)$@ $(_VPATH_SRCS)
 endif
 endif
 
-# need 3 separate lines for OS/2
-%:: %.pl
-	$(RM) $@
-	cp $< $@
-	chmod +x $@
-
-%:: %.sh
-	$(RM) $@
-	cp $< $@
-	chmod +x $@
-
 # Cancel these implicit rules
 #
 %: %,v
 
 %: RCS/%,v
 
+%: RCS/%
+
 %: s.%
 
 %: SCCS/s.%
 
 ###############################################################################
 # Java rules
 ###############################################################################
 ifneq (,$(filter OS2 WINNT,$(OS_ARCH)))
--- a/content/html/document/src/ImageDocument.cpp
+++ b/content/html/document/src/ImageDocument.cpp
@@ -439,28 +439,28 @@ ImageDocument::Notify(imgIRequest* aRequ
     nsCOMPtr<imgIContainer> image;
     aRequest->GetImage(getter_AddRefs(image));
     return OnStartContainer(aRequest, image);
   }
 
   nsDOMTokenList* classList = mImageContent->AsElement()->GetClassList();
   mozilla::ErrorResult rv;
   if (aType == imgINotificationObserver::DECODE_COMPLETE) {
-    if (mImageContent) {
+    if (mImageContent && !nsContentUtils::IsChildOfSameType(this)) {
       // Update the background-color of the image only after the
       // image has been decoded to prevent flashes of just the
       // background-color.
       classList->Add(NS_LITERAL_STRING("decoded"), rv);
       NS_ENSURE_SUCCESS(rv.ErrorCode(), rv.ErrorCode());
     }
   }
 
   if (aType == imgINotificationObserver::DISCARD) {
     // mImageContent can be null if the document is already destroyed
-    if (mImageContent) {
+    if (mImageContent && !nsContentUtils::IsChildOfSameType(this)) {
       // Remove any decoded-related styling when the image is unloaded.
       classList->Remove(NS_LITERAL_STRING("decoded"), rv);
       NS_ENSURE_SUCCESS(rv.ErrorCode(), rv.ErrorCode());
     }
   }
 
   if (aType == imgINotificationObserver::LOAD_COMPLETE) {
     uint32_t reqStatus;
--- a/content/svg/content/src/SVGAnimatedLength.cpp
+++ b/content/svg/content/src/SVGAnimatedLength.cpp
@@ -13,17 +13,16 @@ namespace dom {
 
 NS_SVG_VAL_IMPL_CYCLE_COLLECTION_WRAPPERCACHED(SVGAnimatedLength, mSVGElement)
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(SVGAnimatedLength)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(SVGAnimatedLength)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SVGAnimatedLength)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
-  NS_INTERFACE_MAP_ENTRY(nsIDOMSVGAnimatedLength)
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
 JSObject*
 SVGAnimatedLength::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope)
 {
   return SVGAnimatedLengthBinding::Wrap(aCx, aScope, this);
 }
--- a/content/svg/content/src/SVGAnimatedLength.h
+++ b/content/svg/content/src/SVGAnimatedLength.h
@@ -3,43 +3,36 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_dom_SVGAnimatedLength_h
 #define mozilla_dom_SVGAnimatedLength_h
 
 #include "mozilla/Attributes.h"
 #include "nsSVGElement.h"
-#include "nsIDOMSVGAnimatedLength.h"
 
 class nsSVGLength2;
 class nsIDOMSVGLength;
 
 namespace mozilla {
 namespace dom {
 
-class SVGAnimatedLength MOZ_FINAL : public nsIDOMSVGAnimatedLength,
+class SVGAnimatedLength MOZ_FINAL : public nsISupports,
                                     public nsWrapperCache
 {
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(SVGAnimatedLength)
 
   SVGAnimatedLength(nsSVGLength2* aVal, nsSVGElement *aSVGElement)
     : mVal(aVal), mSVGElement(aSVGElement)
   { SetIsDOMBinding(); }
 
   ~SVGAnimatedLength();
 
-  NS_IMETHOD GetBaseVal(nsIDOMSVGLength **aBaseVal) MOZ_OVERRIDE
-    { *aBaseVal = BaseVal().get(); return NS_OK; }
-
-  NS_IMETHOD GetAnimVal(nsIDOMSVGLength **aAnimVal) MOZ_OVERRIDE
-    { *aAnimVal = AnimVal().get(); return NS_OK; }
-
   // WebIDL
   nsSVGElement* GetParentObject() { return mSVGElement; }
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;
   already_AddRefed<nsIDOMSVGLength> BaseVal();
   already_AddRefed<nsIDOMSVGLength> AnimVal();
 
 protected:
--- a/content/svg/content/src/SVGTextContentElement.cpp
+++ b/content/svg/content/src/SVGTextContentElement.cpp
@@ -2,17 +2,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/SVGTextContentElement.h"
 #include "nsISVGPoint.h"
 #include "nsSVGTextContainerFrame.h"
 #include "nsSVGTextFrame2.h"
-#include "nsIDOMSVGAnimatedLength.h"
 #include "mozilla/dom/SVGIRect.h"
 #include "nsIDOMSVGAnimatedEnum.h"
 
 namespace mozilla {
 namespace dom {
 
 nsSVGTextContainerFrame*
 SVGTextContentElement::GetTextContainerFrame()
--- a/content/svg/content/src/nsSVGLength2.cpp
+++ b/content/svg/content/src/nsSVGLength2.cpp
@@ -466,24 +466,16 @@ nsSVGLength2::SetAnimValueInSpecifiedUni
 void
 nsSVGLength2::SetAnimValue(float aValue, nsSVGElement *aSVGElement)
 {
   SetAnimValueInSpecifiedUnits(aValue * GetUnitScaleFactor(aSVGElement,
                                                            mSpecifiedUnitType),
                                aSVGElement);
 }
 
-nsresult
-nsSVGLength2::ToDOMAnimatedLength(nsIDOMSVGAnimatedLength **aResult,
-                                  nsSVGElement *aSVGElement)
-{
-  *aResult = ToDOMAnimatedLength(aSVGElement).get();
-  return NS_OK;
-}
-
 already_AddRefed<SVGAnimatedLength>
 nsSVGLength2::ToDOMAnimatedLength(nsSVGElement* aSVGElement)
 {
   nsRefPtr<SVGAnimatedLength> svgAnimatedLength =
     sSVGAnimatedLengthTearoffTable.GetTearoff(this);
   if (!svgAnimatedLength) {
     svgAnimatedLength = new SVGAnimatedLength(this, aSVGElement);
     sSVGAnimatedLengthTearoffTable.AddTearoff(this, svgAnimatedLength);
--- a/content/svg/content/src/nsSVGLength2.h
+++ b/content/svg/content/src/nsSVGLength2.h
@@ -6,17 +6,16 @@
 #ifndef __NS_SVGLENGTH2_H__
 #define __NS_SVGLENGTH2_H__
 
 #include "mozilla/Attributes.h"
 #include "nsAutoPtr.h"
 #include "nsCoord.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsError.h"
-#include "nsIDOMSVGAnimatedLength.h"
 #include "nsIDOMSVGLength.h"
 #include "nsISMILAttr.h"
 #include "nsMathUtils.h"
 #include "nsSVGElement.h"
 #include "SVGContentUtils.h"
 
 class nsIFrame;
 class nsSMILValue;
@@ -84,19 +83,16 @@ public:
   }
   // Returns true if the animated value of this length has been explicitly
   // set (either by animation, or by taking on the base value which has been
   // explicitly set by markup or a DOM call), false otherwise.
   // If this returns false, the animated value is still valid, that is,
   // useable, and represents the default base value of the attribute.
   bool IsExplicitlySet() const
     { return mIsAnimated || mIsBaseSet; }
-  
-  nsresult ToDOMAnimatedLength(nsIDOMSVGAnimatedLength **aResult,
-                               nsSVGElement* aSVGElement);
 
   already_AddRefed<mozilla::dom::SVGAnimatedLength>
   ToDOMAnimatedLength(nsSVGElement* aSVGElement);
 
   // Returns a new nsISMILAttr object that the caller must delete
   nsISMILAttr* ToSMILAttr(nsSVGElement* aSVGElement);
 
 private:
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -35,16 +35,17 @@
 #include "mozilla/Hal.h"
 #include "nsIWebNavigation.h"
 #include "nsISiteSpecificUserAgent.h"
 #include "mozilla/ClearOnShutdown.h"
 #include "mozilla/StaticPtr.h"
 #include "Connection.h"
 #include "nsDOMClassInfo.h"
 #include "nsDOMEvent.h"
+#include "nsGlobalWindow.h"
 #ifdef MOZ_B2G_RIL
 #include "IccManager.h"
 #include "MobileConnection.h"
 #include "mozilla/dom/CellBroadcast.h"
 #include "mozilla/dom/Voicemail.h"
 #endif
 #include "nsIIdleObserver.h"
 #include "nsIPermissionManager.h"
--- a/dom/interfaces/svg/moz.build
+++ b/dom/interfaces/svg/moz.build
@@ -2,17 +2,16 @@
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 XPIDL_SOURCES += [
     'nsIDOMSVGAnimatedEnum.idl',
     'nsIDOMSVGAnimatedInteger.idl',
-    'nsIDOMSVGAnimatedLength.idl',
     'nsIDOMSVGAnimatedNumber.idl',
     'nsIDOMSVGElement.idl',
     'nsIDOMSVGLength.idl',
     'nsIDOMSVGNumber.idl',
 ]
 
 XPIDL_MODULE = 'dom_svg'
 
deleted file mode 100644
--- a/dom/interfaces/svg/nsIDOMSVGAnimatedLength.idl
+++ /dev/null
@@ -1,16 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "domstubs.idl"
-
-interface nsIDOMSVGLength;
-
-[scriptable, uuid(a52f0322-7f4d-418d-af6d-a7b14abd5cdf)]
-interface nsIDOMSVGAnimatedLength : nsISupports
-{
-  readonly attribute nsIDOMSVGLength baseVal;
-  readonly attribute nsIDOMSVGLength animVal;
-};
-
--- a/dom/media/tests/mochitest/Makefile.in
+++ b/dom/media/tests/mochitest/Makefile.in
@@ -6,16 +6,21 @@ DEPTH = @DEPTH@
 topsrcdir = @top_srcdir@
 srcdir = @srcdir@
 VPATH = @srcdir@
 relativesrcdir = @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MOCHITEST_FILES = \
+  test_dataChannel_basicAudio.html \
+  test_dataChannel_basicAudioVideo.html \
+  test_dataChannel_basicAudioVideoCombined.html \
+  test_dataChannel_basicDataOnly.html \
+  test_dataChannel_basicVideo.html \
   test_dataChannel_noOffer.html \
   test_getUserMedia_exceptions.html \
   test_getUserMedia_basicAudio.html \
   test_getUserMedia_basicVideo.html \
   test_getUserMedia_basicVideoAudio.html \
   test_getUserMedia_gumWithinGum.html \
   test_getUserMedia_playAudioTwice.html \
   test_getUserMedia_playVideoTwice.html \
@@ -45,16 +50,17 @@ MOCHITEST_FILES = \
   test_peerConnection_bug822674.html \
   test_peerConnection_bug825703.html \
   test_peerConnection_bug827843.html \
   test_peerConnection_bug834153.html \
   test_peerConnection_bug835370.html \
   head.js \
   mediaStreamPlayback.js \
   pc.js \
+  templates.js \
   $(NULL)
 
 # The following tests are leaking and cannot be run by default yet
 ifdef MOZ_WEBRTC_LEAKING_TESTS
 MOCHITEST_FILES += \
   $(NULL)
 endif
 
--- a/dom/media/tests/mochitest/head.js
+++ b/dom/media/tests/mochitest/head.js
@@ -161,16 +161,39 @@ function checkMediaStreamTracksByType(co
 function checkMediaStreamTracks(constraints, mediaStream) {
   checkMediaStreamTracksByType(constraints, 'audio',
     mediaStream.getAudioTracks());
   checkMediaStreamTracksByType(constraints, 'video',
     mediaStream.getVideoTracks());
 }
 
 /**
+ * Utility methods
+ */
+
+/**
+ * Returns the contents of a blob as text
+ *
+ * @param {Blob} blob
+          The blob to retrieve the contents from
+ * @param {Function} onSuccess
+          Callback with the blobs content as parameter
+ */
+function getBlobContent(blob, onSuccess) {
+  var reader = new FileReader();
+
+  // Listen for 'onloadend' which will always be called after a success or failure
+  reader.onloadend = function (event) {
+    onSuccess(event.target.result);
+  };
+
+  reader.readAsText(blob);
+}
+
+/**
  * Generates a callback function fired only under unexpected circumstances
  * while running the tests. The generated function kills off the test as well
  * gracefully.
  *
  * @param {String} [message]
  *        An optional message to show if no object gets passed into the
  *        generated callback method.
  */
--- a/dom/media/tests/mochitest/pc.js
+++ b/dom/media/tests/mochitest/pc.js
@@ -6,21 +6,23 @@
 /**
  * This class mimics a state machine and handles a list of commands by
  * executing them synchronously.
  *
  * @constructor
  * @param {object} framework
  *        A back reference to the framework which makes use of the class. It's
  *        getting passed in as parameter to each command callback.
+ * @param {Array[]} [commandList=[]]
+ *        Default commands to set during initialization
  */
-function CommandChain(framework) {
+function CommandChain(framework, commandList) {
   this._framework = framework;
 
-  this._commands = [ ];
+  this._commands = commandList || [ ];
   this._current = 0;
 
   this.onFinished = null;
 }
 
 CommandChain.prototype = {
 
   /**
@@ -220,153 +222,68 @@ CommandChain.prototype = {
   replaceBefore : function (id, commands) {
     var oldCommands = this.removeBefore(id);
     this.insertBefore(id, commands);
 
     return oldCommands;
   }
 };
 
-
-/**
- * Default list of commands to execute for a PeerConnection test.
- */
-var commandsPeerConnection = [
-  [
-    'PC_LOCAL_GUM',
-    function (test) {
-      test.pcLocal.getAllUserMedia(function () {
-        test.next();
-      });
-    }
-  ],
-  [
-    'PC_REMOTE_GUM',
-    function (test) {
-      test.pcRemote.getAllUserMedia(function () {
-        test.next();
-      });
-    }
-  ],
-  [
-    'PC_CHECK_INITIAL_SIGNALINGSTATE',
-    function (test) {
-      is(test.pcLocal.signalingState, "stable",
-         "Initial local signalingState is 'stable'");
-      is(test.pcRemote.signalingState, "stable",
-         "Initial remote signalingState is 'stable'");
-      test.next();
-    }
-  ],
-  [
-    'PC_LOCAL_CREATE_OFFER',
-    function (test) {
-      test.createOffer(test.pcLocal, function () {
-        is(test.pcLocal.signalingState, "stable",
-           "Local create offer does not change signaling state");
-        test.next();
-      });
-    }
-  ],
-  [
-    'PC_LOCAL_SET_LOCAL_DESCRIPTION',
-    function (test) {
-      test.setLocalDescription(test.pcLocal, test.pcLocal._last_offer, function () {
-        is(test.pcLocal.signalingState, "have-local-offer",
-           "signalingState after local setLocalDescription is 'have-local-offer'");
-        test.next();
-      });
-    }
-  ],
-  [
-    'PC_REMOTE_SET_REMOTE_DESCRIPTION',
-    function (test) {
-      test.setRemoteDescription(test.pcRemote, test.pcLocal._last_offer, function () {
-        is(test.pcRemote.signalingState, "have-remote-offer",
-           "signalingState after remote setRemoteDescription is 'have-remote-offer'");
-        test.next();
-      });
-    }
-  ],
-  [
-    'PC_REMOTE_CREATE_ANSWER',
-    function (test) {
-      test.createAnswer(test.pcRemote, function () {
-        is(test.pcRemote.signalingState, "have-remote-offer",
-           "Remote createAnswer does not change signaling state");
-        test.next();
-      });
-    }
-  ],
-  [
-    'PC_LOCAL_SET_REMOTE_DESCRIPTION',
-    function (test) {
-      test.setRemoteDescription(test.pcLocal, test.pcRemote._last_answer, function () {
-        is(test.pcLocal.signalingState, "stable",
-           "signalingState after local setRemoteDescription is 'stable'");
-        test.next();
-      });
-    }
-  ],
-  [
-    'PC_REMOTE_SET_LOCAL_DESCRIPTION',
-    function (test) {
-      test.setLocalDescription(test.pcRemote, test.pcRemote._last_answer, function () {
-        is(test.pcRemote.signalingState, "stable",
-           "signalingState after remote setLocalDescription is 'stable'");
-        test.next();
-      });
-    }
-  ],
-  [
-    'PC_LOCAL_CHECK_MEDIA',
-    function (test) {
-      test.pcLocal.checkMedia(test.pcRemote.constraints);
-      test.next();
-    }
-  ],
-  [
-    'PC_REMOTE_CHECK_MEDIA',
-    function (test) {
-      test.pcRemote.checkMedia(test.pcLocal.constraints);
-      test.next();
-    }
-  ]
-];
-
 /**
  * This class handles tests for peer connections.
  *
  * @constructor
  * @param {object} [options={}]
  *        Optional options for the peer connection test
+ * @param {object} [options.commands=commandsPeerConnection]
+ *        Commands to run for the test
  * @param {object} [options.config_pc1=undefined]
  *        Configuration for the local peer connection instance
  * @param {object} [options.config_pc2=undefined]
  *        Configuration for the remote peer connection instance. If not defined
  *        the configuration from the local instance will be used
  */
 function PeerConnectionTest(options) {
   // If no options are specified make it an empty object
   options = options || { };
+  options.commands = options.commands || commandsPeerConnection;
 
   this.pcLocal = new PeerConnectionWrapper('pcLocal', options.config_pc1);
   this.pcRemote = new PeerConnectionWrapper('pcRemote', options.config_pc2 || options.config_pc1);
 
+  this.connected = false;
+
   // Create command chain instance and assign default commands
-  this.chain = new CommandChain(this);
-  this.chain.commands = commandsPeerConnection;
+  this.chain = new CommandChain(this, options.commands);
 
   var self = this;
   this.chain.onFinished = function () {
     self.teardown();
   }
 }
 
 /**
+ * Closes the peer connection if it is active
+ *
+ * @param {Function} onSuccess
+ *        Callback to execute when the peer connection has been closed successfully
+ */
+PeerConnectionTest.prototype.close = function PCT_close(onSuccess) {
+  info("Closing peer connections. Connection state=" + this.connected);
+
+  // There is no onclose event for the remote peer existent yet. So close it
+  // side-by-side with the local peer.
+  this.pcLocal.close();
+  this.pcRemote.close();
+  this.connected = false;
+
+  onSuccess();
+};
+
+/**
  * Executes the next command.
  */
 PeerConnectionTest.prototype.next = function PCT_next() {
   this.chain.executeNext();
 };
 
 /**
  * Creates an answer for the specified peer connection instance
@@ -499,63 +416,433 @@ function PCT_setRemoteDescription(peer, 
 PeerConnectionTest.prototype.run = function PCT_run() {
   this.next();
 };
 
 /**
  * Clean up the objects used by the test
  */
 PeerConnectionTest.prototype.teardown = function PCT_teardown() {
-  if (this.pcLocal) {
-    this.pcLocal.close();
-    this.pcLocal = null;
-  }
+  this.close(function () {
+    info("Test finished");
+    SimpleTest.finish();
+  });
+};
+
+/**
+ * This class handles tests for data channels.
+ *
+ * @constructor
+ * @param {object} [options={}]
+ *        Optional options for the peer connection test
+ * @param {object} [options.commands=commandsDataChannel]
+ *        Commands to run for the test
+ * @param {object} [options.config_pc1=undefined]
+ *        Configuration for the local peer connection instance
+ * @param {object} [options.config_pc2=undefined]
+ *        Configuration for the remote peer connection instance. If not defined
+ *        the configuration from the local instance will be used
+ */
+function DataChannelTest(options) {
+  options = options || { };
+  options.commands = options.commands || commandsDataChannel;
+
+  PeerConnectionTest.call(this, options);
+}
+
+DataChannelTest.prototype = Object.create(PeerConnectionTest.prototype, {
+  close : {
+    /**
+     * Close the open data channels, followed by the underlying peer connection
+     *
+     * @param {Function} onSuccess
+     *        Callback to execute when the connection has been closed
+     */
+    value : function DCT_close(onSuccess) {
+      var self = this;
+
+      function _closeChannels() {
+        var length = self.pcLocal.dataChannels.length;
+
+        if (length > 0) {
+          self.closeDataChannel(length - 1, function () {
+            _closeChannels();
+          });
+        }
+        else {
+          PeerConnectionTest.prototype.close.call(self, onSuccess);
+        }
+      }
+
+      _closeChannels();
+    }
+  },
+
+  closeDataChannel : {
+    /**
+     * Close the specified data channel
+     *
+     * @param {Number} index
+     *        Index of the data channel to close on both sides
+     * @param {Function} onSuccess
+     *        Callback to execute when the data channel has been closed
+     */
+    value : function DCT_closeDataChannel(index, onSuccess) {
+      var localChannel = this.pcLocal.dataChannels[index];
+      var remoteChannel = this.pcRemote.dataChannels[index];
+
+      var self = this;
+
+      // Register handler for remote channel, cause we have to wait until
+      // the current close operation has been finished.
+      remoteChannel.onclose = function () {
+        self.pcRemote.dataChannels.splice(index, 1);
+
+        onSuccess(remoteChannel);
+      };
+
+      localChannel.close();
+      this.pcLocal.dataChannels.splice(index, 1);
+    }
+  },
+
+  createDataChannel : {
+    /**
+     * Create a data channel
+     *
+     * @param {Dict} options
+     *        Options for the data channel (see nsIPeerConnection)
+     * @param {Function} onSuccess
+     *        Callback when the creation was successful
+     */
+    value : function DCT_createDataChannel(options, onSuccess) {
+      var localChannel = null;
+      var remoteChannel = null;
+      var self = this;
+
+      // Method to synchronize all asynchronous events.
+      function check_next_test() {
+        if (self.connected && localChannel && remoteChannel) {
+          onSuccess(localChannel, remoteChannel);
+        }
+      }
+
+      // Register handlers for the remote peer
+      this.pcRemote.registerDataChannelOpenEvents(function (channel) {
+        remoteChannel = channel;
+        check_next_test();
+      });
+
+      // Creat the datachannel and handle the local 'onopen' event
+      this.pcLocal.createDataChannel(options, function (channel) {
+        localChannel = channel;
+        check_next_test();
+      });
+    }
+  },
+
+  send : {
+    /**
+     * Send data (message or blob) to the other peer
+     *
+     * @param {String|Blob} data
+     *        Data to send to the other peer. For Blobs the MIME type will be lost.
+     * @param {Function} onSuccess
+     *        Callback to execute when data has been sent
+     * @param {Object} [options={ }]
+     *        Options to specify the data channels to be used
+     * @param {DataChannelWrapper} [options.sourceChannel=pcLocal.dataChannels[length - 1]]
+     *        Data channel to use for sending the message
+     * @param {DataChannelWrapper} [options.targetChannel=pcRemote.dataChannels[length - 1]]
+     *        Data channel to use for receiving the message
+     */
+    value : function DCT_send(data, onSuccess, options) {
+      options = options || { };
+      source = options.sourceChannel ||
+               this.pcLocal.dataChannels[this.pcLocal.dataChannels.length - 1];
+      target = options.targetChannel ||
+               this.pcRemote.dataChannels[this.pcRemote.dataChannels.length - 1];
+
+      // Register event handler for the target channel
+      target.onmessage = function (recv_data) {
+        onSuccess(target, recv_data);
+      };
+
+      source.send(data);
+    }
+  },
+
+  setLocalDescription : {
+    /**
+     * Sets the local description for the specified peer connection instance
+     * and automatically handles the failure case. In case for the final call
+     * it will setup the requested datachannel.
+     *
+     * @param {PeerConnectionWrapper} peer
+              The peer connection wrapper to run the command on
+     * @param {mozRTCSessionDescription} desc
+     *        Session description for the local description request
+     * @param {function} onSuccess
+     *        Callback to execute if the local description was set successfully
+     */
+    value : function DCT_setLocalDescription(peer, desc, onSuccess) {
+      // If the peer has a remote offer we are in the final call, and have
+      // to wait for the datachannel connection to be open. It will also set
+      // the local description internally.
+      if (peer.signalingState === 'have-remote-offer') {
+        this.waitForInitialDataChannel(peer, desc, onSuccess);
+      }
+      else {
+        PeerConnectionTest.prototype.setLocalDescription.call(this, peer,
+                                                              desc, onSuccess);
+      }
+
+    }
+  },
 
-  if (this.pcRemote) {
-    this.pcRemote.close();
-    this.pcRemote = null;
+  waitForInitialDataChannel : {
+    /**
+     * Create an initial data channel before the peer connection has been connected
+     *
+     * @param {PeerConnectionWrapper} peer
+              The peer connection wrapper to run the command on
+     * @param {mozRTCSessionDescription} desc
+     *        Session description for the local description request
+     * @param {Function} onSuccess
+     *        Callback when the creation was successful
+     */
+    value : function DCT_waitForInitialDataChannel(peer, desc, onSuccess) {
+      var self = this;
+
+      var targetPeer = peer;
+      var targetChannel = null;
+
+      var sourcePeer = (peer == this.pcLocal) ? this.pcRemote : this.pcLocal;
+      var sourceChannel = null;
+
+      // Method to synchronize all asynchronous events which current happen
+      // due to a non-predictable flow. With bug 875346 fixed we will be able
+      // to simplify this code.
+      function check_next_test() {
+        if (self.connected && sourceChannel && targetChannel) {
+          onSuccess(sourceChannel, targetChannel);
+        }
+      }
+
+      // Register 'onopen' handler for the first local data channel
+      sourcePeer.dataChannels[0].onopen = function (channel) {
+        sourceChannel = channel;
+        check_next_test();
+      };
+
+      // Register handlers for the target peer
+      targetPeer.registerDataChannelOpenEvents(function (channel) {
+        targetChannel = channel;
+        check_next_test();
+      });
+
+      PeerConnectionTest.prototype.setLocalDescription.call(this, targetPeer, desc,
+        function () {
+          self.connected = true;
+          check_next_test();
+        }
+      );
+    }
   }
+});
 
-  info("Test finished");
-  SimpleTest.finish();
+/**
+ * This class acts as a wrapper around a DataChannel instance.
+ *
+ * @param dataChannel
+ * @param peerConnectionWrapper
+ * @constructor
+ */
+function DataChannelWrapper(dataChannel, peerConnectionWrapper) {
+  this._channel = dataChannel;
+  this._pc = peerConnectionWrapper;
+
+  info("Creating " + this);
+
+  /**
+   * Setup appropriate callbacks
+   */
+
+  this.onclose = unexpectedEventAndFinish(this, 'onclose');
+  this.onerror = unexpectedEventAndFinish(this, 'onerror');
+  this.onmessage = unexpectedEventAndFinish(this, 'onmessage');
+  this.onopen = unexpectedEventAndFinish(this, 'onopen');
+
+  var self = this;
+
+  /**
+   * Callback for native data channel 'onclose' events. If no custom handler
+   * has been specified via 'this.onclose', a failure will be raised if an
+   * event of this type gets caught.
+   */
+  this._channel.onclose = function () {
+    info(self + ": 'onclose' event fired");
+
+    self.onclose(self);
+    self.onclose = unexpectedEventAndFinish(self, 'onclose');
+  };
+
+  /**
+   * Callback for native data channel 'onmessage' events. If no custom handler
+   * has been specified via 'this.onmessage', a failure will be raised if an
+   * event of this type gets caught.
+   *
+   * @param {Object} event
+   *        Event data which includes the sent message
+   */
+  this._channel.onmessage = function (event) {
+    info(self + ": 'onmessage' event fired for '" + event.data + "'");
+
+    self.onmessage(event.data);
+    self.onmessage = unexpectedEventAndFinish(self, 'onmessage');
+  };
+
+  /**
+   * Callback for native data channel 'onopen' events. If no custom handler
+   * has been specified via 'this.onopen', a failure will be raised if an
+   * event of this type gets caught.
+   */
+  this._channel.onopen = function () {
+    info(self + ": 'onopen' event fired");
+
+    self.onopen(self);
+    self.onopen = unexpectedEventAndFinish(self, 'onopen');
+  };
+}
+
+DataChannelWrapper.prototype = {
+  /**
+   * Returns the binary type of the channel
+   *
+   * @returns {String} The binary type
+   */
+  get binaryType() {
+    return this._channel.binaryType;
+  },
+
+  /**
+   * Sets the binary type of the channel
+   *
+   * @param {String} type
+   *        The new binary type of the channel
+   */
+  set binaryType(type) {
+    this._channel.binaryType = type;
+  },
+
+  /**
+   * Returns the label of the underlying data channel
+   *
+   * @returns {String} The label
+   */
+  get label() {
+    return this._channel.label;
+  },
+
+  /**
+   * Returns the readyState bit of the data channel
+   *
+   * @returns {String} The state of the channel
+   */
+  get readyState() {
+    return this._channel.readyState;
+  },
+
+  /**
+   * Close the data channel
+   */
+  close : function () {
+    info(this + ": Closing channel");
+    this._channel.close();
+  },
+
+  /**
+   * Send data through the data channel
+   *
+   * @param {String|Object} data
+   *        Data which has to be sent through the data channel
+   */
+  send: function DCW_send(data) {
+    info(this + ": Sending data '" + data + "'");
+    this._channel.send(data);
+  },
+
+  /**
+   * Returns the string representation of the class
+   *
+   * @returns {String} The string representation
+   */
+  toString: function DCW_toString() {
+    return "DataChannelWrapper (" + this._pc.label + '_' + this._channel.label + ")";
+  }
 };
 
 
 /**
- * This class handles acts as a wrapper around a PeerConnection instance.
+ * This class acts as a wrapper around a PeerConnection instance.
  *
  * @constructor
  * @param {string} label
  *        Description for the peer connection instance
  * @param {object} configuration
  *        Configuration for the peer connection instance
  */
 function PeerConnectionWrapper(label, configuration) {
   this.configuration = configuration;
   this.label = label;
 
   this.constraints = [ ];
   this.offerConstraints = {};
   this.streams = [ ];
 
-  info("Creating new PeerConnectionWrapper: " + this);
+  this.dataChannels = [ ];
+
+  info("Creating " + this);
   this._pc = new mozRTCPeerConnection(this.configuration);
 
   /**
    * Setup callback handlers
    */
 
+  this.ondatachannel = unexpectedEventAndFinish(this, 'ondatachannel');
   this.onsignalingstatechange = unexpectedEventAndFinish(this, 'onsignalingstatechange');
 
-
+  /**
+   * Callback for native peer connection 'onaddstream' events.
+   *
+   * @param {Object} event
+   *        Event data which includes the stream to be added
+   */
   var self = this;
   this._pc.onaddstream = function (event) {
-    // Bug 834835: Assume type is video until we get get{Audio,Video}Tracks.
+    info(self + ": 'onaddstream' event fired for " + event.stream);
+
+    // TODO: Bug 834835 - Assume type is video until we get get{Audio,Video}Tracks.
     self.attachMedia(event.stream, 'video', 'remote');
-  };
+   };
+
+  /**
+   * Callback for native peer connection 'ondatachannel' events. If no custom handler
+   * has been specified via 'this.ondatachannel', a failure will be raised if an
+   * event of this type gets caught.
+   *
+   * @param {Object} event
+   *        Event data which includes the newly created data channel
+   */
+  this._pc.ondatachannel = function (event) {
+    info(self + ": 'ondatachannel' event fired for " + event.channel.label);
+
+    self.ondatachannel(new DataChannelWrapper(event.channel, self));
+    self.ondatachannel = unexpectedEventAndFinish(self, 'ondatachannel');
+  }
 
   /**
    * Callback for native peer connection 'onsignalingstatechange' events. If no
    * custom handler has been specified via 'this.onsignalingstatechange', a
    * failure will be raised if an event of this type is caught.
    *
    * @param {Object} aEvent
    *        Event data which includes the newly created data channel
@@ -585,16 +872,25 @@ PeerConnectionWrapper.prototype = {
    * @param {object} desc
    *        The new local description
    */
   set localDescription(desc) {
     this._pc.localDescription = desc;
   },
 
   /**
+   * Returns the readyState.
+   *
+   * @returns {string}
+   */
+  get readyState() {
+    return this._pc.readyState;
+  },
+
+  /**
    * Returns the remote description.
    *
    * @returns {object} The remote description
    */
   get remoteDescription() {
     return this._pc.remoteDescription;
   },
 
@@ -674,16 +970,42 @@ PeerConnectionWrapper.prototype = {
       }
     }
 
     info("Get " + this.constraints.length + " local streams");
     _getAllUserMedia(this.constraints, 0);
   },
 
   /**
+   * Create a new data channel instance
+   *
+   * @param {Object} options
+   *        Options which get forwarded to nsIPeerConnection.createDataChannel
+   * @param {function} [onCreation=undefined]
+   *        Callback to execute when the local data channel has been created
+   * @returns {DataChannelWrapper} The created data channel
+   */
+  createDataChannel : function PCW_createDataChannel(options, onCreation) {
+    var label = 'channel_' + this.dataChannels.length;
+    info(this + ": Create data channel '" + label);
+
+    var channel = this._pc.createDataChannel(label, options);
+    var wrapper = new DataChannelWrapper(channel, this);
+
+    if (onCreation) {
+      wrapper.onopen = function () {
+        onCreation(wrapper);
+      }
+    }
+
+    this.dataChannels.push(wrapper);
+    return wrapper;
+  },
+
+  /**
    * Creates an offer and automatically handles the failure case.
    *
    * @param {function} onSuccess
    *        Callback to execute if the offer was created successfully
    */
   createOffer : function PCW_createOffer(onSuccess) {
     var self = this;
 
@@ -822,34 +1144,55 @@ PeerConnectionWrapper.prototype = {
    *
    * @param {object} constraintsRemote
    *        The media constraints of the remote peer connection object
    */
   checkMedia : function PCW_checkMedia(constraintsRemote) {
     is(this._pc.localStreams.length, this.constraints.length,
        this + ' has ' + this.constraints.length + ' local streams');
 
-    // TODO: change this when multiple incoming streams are allowed.
+    // TODO: change this when multiple incoming streams are supported (bug 834835)
     is(this._pc.remoteStreams.length, 1,
        this + ' has ' + 1 + ' remote streams');
   },
 
   /**
    * Closes the connection
    */
   close : function PCW_close() {
     // It might be that a test has already closed the pc. In those cases
     // we should not fail.
     try {
       this._pc.close();
       info(this + ": Closed connection.");
-    } catch (e) {
+    }
+    catch (e) {
       info(this + ": Failure in closing connection - " + e.message);
     }
   },
 
   /**
-   * Returns the string representation of the object
+   * Register all events during the setup of the data channel
+   *
+   * @param {Function} onDataChannelOpened
+   *        Callback to execute when the data channel has been opened
+   */
+  registerDataChannelOpenEvents : function (onDataChannelOpened) {
+    info(this + ": Register callbacks for 'ondatachannel' and 'onopen'");
+
+    this.ondatachannel = function (targetChannel) {
+      targetChannel.onopen = function (targetChannel) {
+        onDataChannelOpened(targetChannel);
+      };
+
+      this.dataChannels.push(targetChannel);
+    }
+  },
+
+  /**
+   * Returns the string representation of the class
+   *
+   * @returns {String} The string representation
    */
   toString : function PCW_toString() {
     return "PeerConnectionWrapper (" + this.label + ")";
   }
 };
new file mode 100644
--- /dev/null
+++ b/dom/media/tests/mochitest/templates.js
@@ -0,0 +1,320 @@
+/**
+ * Default list of commands to execute for a PeerConnection test.
+ */
+var commandsPeerConnection = [
+  [
+    'PC_LOCAL_GUM',
+    function (test) {
+      test.pcLocal.getAllUserMedia(function () {
+        test.next();
+      });
+    }
+  ],
+  [
+    'PC_REMOTE_GUM',
+    function (test) {
+      test.pcRemote.getAllUserMedia(function () {
+        test.next();
+      });
+    }
+  ],
+  [
+    'PC_CHECK_INITIAL_SIGNALINGSTATE',
+    function (test) {
+      is(test.pcLocal.signalingState, "stable",
+         "Initial local signalingState is 'stable'");
+      is(test.pcRemote.signalingState, "stable",
+         "Initial remote signalingState is 'stable'");
+      test.next();
+    }
+  ],
+  [
+    'PC_LOCAL_CREATE_OFFER',
+    function (test) {
+      test.createOffer(test.pcLocal, function () {
+        is(test.pcLocal.signalingState, "stable",
+           "Local create offer does not change signaling state");
+        test.next();
+      });
+    }
+  ],
+  [
+    'PC_LOCAL_SET_LOCAL_DESCRIPTION',
+    function (test) {
+      test.setLocalDescription(test.pcLocal, test.pcLocal._last_offer, function () {
+        is(test.pcLocal.signalingState, "have-local-offer",
+           "signalingState after local setLocalDescription is 'have-local-offer'");
+        test.next();
+      });
+    }
+  ],
+  [
+    'PC_REMOTE_SET_REMOTE_DESCRIPTION',
+    function (test) {
+      test.setRemoteDescription(test.pcRemote, test.pcLocal._last_offer, function () {
+        is(test.pcRemote.signalingState, "have-remote-offer",
+           "signalingState after remote setRemoteDescription is 'have-remote-offer'");
+        test.next();
+      });
+    }
+  ],
+  [
+    'PC_REMOTE_CREATE_ANSWER',
+    function (test) {
+      test.createAnswer(test.pcRemote, function () {
+        is(test.pcRemote.signalingState, "have-remote-offer",
+           "Remote createAnswer does not change signaling state");
+        test.next();
+      });
+    }
+  ],
+  [
+    'PC_LOCAL_SET_REMOTE_DESCRIPTION',
+    function (test) {
+      test.setRemoteDescription(test.pcLocal, test.pcRemote._last_answer, function () {
+        is(test.pcLocal.signalingState, "stable",
+           "signalingState after local setRemoteDescription is 'stable'");
+        test.next();
+      });
+    }
+  ],
+  [
+    'PC_REMOTE_SET_LOCAL_DESCRIPTION',
+    function (test) {
+      test.setLocalDescription(test.pcRemote, test.pcRemote._last_answer, function () {
+        is(test.pcRemote.signalingState, "stable",
+           "signalingState after remote setLocalDescription is 'stable'");
+        test.next();
+      });
+    }
+  ],
+  [
+    'PC_LOCAL_CHECK_MEDIA',
+    function (test) {
+      test.pcLocal.checkMedia(test.pcRemote.constraints);
+      test.next();
+    }
+  ],
+  [
+    'PC_REMOTE_CHECK_MEDIA',
+    function (test) {
+      test.pcRemote.checkMedia(test.pcLocal.constraints);
+      test.next();
+    }
+  ]
+];
+
+
+/**
+ * Default list of commands to execute for a Datachannel test.
+ */
+var commandsDataChannel = [
+  [
+    'PC_LOCAL_GUM',
+    function (test) {
+      test.pcLocal.getAllUserMedia(function () {
+        test.next();
+      });
+    }
+  ],
+  [
+    'PC_REMOTE_GUM',
+    function (test) {
+      test.pcRemote.getAllUserMedia(function () {
+        test.next();
+      });
+    }
+  ],
+  [
+    'PC_CHECK_INITIAL_SIGNALINGSTATE',
+    function (test) {
+      is(test.pcLocal.signalingState, "stable",
+         "Initial local signalingState is stable");
+      is(test.pcRemote.signalingState, "stable",
+         "Initial remote signalingState is stable");
+      test.next();
+    }
+  ],
+  [
+    'PC_LOCAL_CREATE_DATA_CHANNEL',
+    function (test) {
+      var channel = test.pcLocal.createDataChannel({});
+
+      is(channel.binaryType, "blob", channel + " is of binary type 'blob'");
+      is(channel.readyState, "connecting", channel + " is in state: 'connecting'");
+
+      is(test.pcLocal.signalingState, "stable",
+         "Create datachannel does not change signaling state");
+
+      test.next();
+    }
+  ],
+  [
+    'PC_LOCAL_CREATE_OFFER',
+    function (test) {
+      test.pcLocal.createOffer(function (offer) {
+        is(test.pcLocal.signalingState, "stable",
+           "Local create offer does not change signaling state");
+        ok(offer.sdp.contains("m=application"),
+           "m=application is contained in the SDP");
+        test.next();
+      });
+    }
+  ],
+  [
+    'PC_LOCAL_SET_LOCAL_DESCRIPTION',
+    function (test) {
+      test.setLocalDescription(test.pcLocal, test.pcLocal._last_offer, function () {
+        is(test.pcLocal.signalingState, "have-local-offer",
+           "signalingState after local setLocalDescription is 'have-local-offer'");
+        test.next();
+      });
+    }
+  ],
+  [
+    'PC_REMOTE_SET_REMOTE_DESCRIPTION',
+    function (test) {
+      test.setRemoteDescription(test.pcRemote, test.pcLocal._last_offer, function () {
+        is(test.pcRemote.signalingState, "have-remote-offer",
+           "signalingState after remote setRemoteDescription is 'have-remote-offer'");
+        test.next();
+      });
+    }
+  ],
+  [
+    'PC_REMOTE_CREATE_ANSWER',
+    function (test) {
+      test.createAnswer(test.pcRemote, function () {
+        is(test.pcRemote.signalingState, "have-remote-offer",
+           "Remote create offer does not change signaling state");
+        test.next();
+      });
+    }
+  ],
+  [
+    'PC_LOCAL_SET_REMOTE_DESCRIPTION',
+    function (test) {
+      test.setRemoteDescription(test.pcLocal, test.pcRemote._last_answer, function () {
+        is(test.pcLocal.signalingState, "stable",
+           "signalingState after local setRemoteDescription is 'stable'");
+        test.next();
+      });
+    }
+  ],
+  [
+    'PC_REMOTE_SET_LOCAL_DESCRIPTION',
+    function (test) {
+      test.setLocalDescription(test.pcRemote, test.pcRemote._last_answer,
+        function (sourceChannel, targetChannel) {
+          is(sourceChannel.readyState, "open", test.pcLocal + " is in state: 'open'");
+          is(targetChannel.readyState, "open", test.pcRemote + " is in state: 'open'");
+
+          is(test.pcRemote.signalingState, "stable",
+             "signalingState after remote setLocalDescription is 'stable'");
+          test.next();
+        }
+      );
+    }
+  ],
+  [
+    'PC_LOCAL_CHECK_MEDIA',
+    function (test) {
+      test.pcLocal.checkMedia(test.pcRemote.constraints);
+      test.next();
+    }
+  ],
+  [
+    'PC_REMOTE_CHECK_MEDIA',
+    function (test) {
+      test.pcRemote.checkMedia(test.pcLocal.constraints);
+      test.next();
+    }
+  ],
+  [
+    'SEND_MESSAGE',
+    function (test) {
+      var message = "Lorem ipsum dolor sit amet";
+
+      test.send(message, function (channel, data) {
+        is(data, message, "Message correctly transmitted from pcLocal to pcRemote.");
+
+        test.next();
+      });
+    }
+  ],
+  [
+    'SEND_BLOB',
+    function (test) {
+      var contents = ["At vero eos et accusam et justo duo dolores et ea rebum."];
+      var blob = new Blob(contents, { "type" : "text/plain" });
+
+      test.send(blob, function (channel, data) {
+        ok(data instanceof Blob, "Received data is of instance Blob");
+        is(data.size, blob.size, "Received data has the correct size.");
+
+        getBlobContent(data, function (recv_contents) {
+          is(recv_contents, contents, "Received data has the correct content.");
+
+          test.next();
+        });
+      });
+    }
+  ],
+  [
+    'CREATE_SECOND_DATA_CHANNEL',
+    function (test) {
+      test.createDataChannel({ }, function (sourceChannel, targetChannel) {
+        is(sourceChannel.readyState, "open", sourceChannel + " is in state: 'open'");
+        is(targetChannel.readyState, "open", targetChannel + " is in state: 'open'");
+
+        is(targetChannel.binaryType, "blob", targetChannel + " is of binary type 'blob'");
+        is(targetChannel.readyState, "open", targetChannel + " is in state: 'open'");
+
+        test.next();
+      });
+    }
+  ],
+  [
+    'SEND_MESSAGE_THROUGH_LAST_OPENED_CHANNEL',
+    function (test) {
+      var channels = test.pcRemote.dataChannels;
+      var message = "Lorem ipsum dolor sit amet";
+
+      test.send(message, function (channel, data) {
+        is(channels.indexOf(channel), channels.length - 1, "Last channel used");
+        is(data, message, "Received message has the correct content.");
+
+        test.next();
+      });
+    }
+  ],
+  [
+    'SEND_MESSAGE_THROUGH_FIRST_CHANNEL',
+    function (test) {
+      var message = "Message through 1st channel";
+      var options = {
+        sourceChannel: test.pcLocal.dataChannels[0],
+        targetChannel: test.pcRemote.dataChannels[0]
+      };
+
+      test.send(message, function (channel, data) {
+        is(test.pcRemote.dataChannels.indexOf(channel), 0, "1st channel used");
+        is(data, message, "Received message has the correct content.");
+
+        test.next();
+      }, options);
+    }
+  ],
+  [
+    'CLOSE_LAST_OPENED_DATA_CHANNEL',
+    function (test) {
+      var channels = test.pcRemote.dataChannels;
+
+      test.closeDataChannel(channels.length - 1, function (channel) {
+        is(channel.readyState, "closed", "Channel is in state: 'closed'");
+
+        test.next();
+      });
+    }
+  ]
+];
new file mode 100644
--- /dev/null
+++ b/dom/media/tests/mochitest/test_dataChannel_basicAudio.html
@@ -0,0 +1,28 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="application/javascript" src="head.js"></script>
+  <script type="application/javascript" src="pc.js"></script>
+  <script type="application/javascript" src="templates.js"></script>
+</head>
+<body>
+<pre id="test">
+<script type="application/javascript">
+  createHTML({
+    bug: "796895",
+    title: "Basic data channel audio connection"
+  });
+
+  var test;
+  runTest(function () {
+    test = new DataChannelTest();
+    test.setMediaConstraints([{audio: true}], [{audio: true}]);
+    test.run();
+  }, true);
+
+</script>
+</pre>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/dom/media/tests/mochitest/test_dataChannel_basicAudioVideo.html
@@ -0,0 +1,29 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="application/javascript" src="head.js"></script>
+  <script type="application/javascript" src="pc.js"></script>
+  <script type="application/javascript" src="templates.js"></script>
+</head>
+<body>
+<pre id="test">
+<script type="application/javascript">
+  createHTML({
+    bug: "796891",
+    title: "Basic data channel audio/video connection"
+  });
+
+  var test;
+  runTest(function () {
+    test = new DataChannelTest();
+    test.setMediaConstraints([{audio: true}, {video: true}],
+                             [{audio: true}, {video: true}]);
+    test.run();
+  }, true);
+
+</script>
+</pre>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/dom/media/tests/mochitest/test_dataChannel_basicAudioVideoCombined.html
@@ -0,0 +1,29 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="application/javascript" src="head.js"></script>
+  <script type="application/javascript" src="pc.js"></script>
+  <script type="application/javascript" src="templates.js"></script>
+</head>
+<body>
+<pre id="test">
+<script type="application/javascript">
+  createHTML({
+    bug: "796891",
+    title: "Basic data channel audio/video connection"
+  });
+
+  var test;
+  runTest(function () {
+    test = new DataChannelTest();
+    test.setMediaConstraints([{audio: true, video: true}],
+                             [{audio: true, video: true}]);
+    test.run();
+  }, true);
+
+</script>
+</pre>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/dom/media/tests/mochitest/test_dataChannel_basicDataOnly.html
@@ -0,0 +1,32 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="application/javascript" src="head.js"></script>
+  <script type="application/javascript" src="pc.js"></script>
+  <script type="application/javascript" src="templates.js"></script>
+</head>
+<body>
+<pre id="test">
+<script type="application/javascript">
+  createHTML({
+    bug: "796894",
+    title: "Basic datachannel only connection"
+  });
+
+  var test;
+  runTest(function () {
+    test = new DataChannelTest();
+
+    // TODO: Add back once bug 873049 has been fixed
+    test.chain.remove("PC_LOCAL_CHECK_MEDIA");
+    test.chain.remove("PC_REMOTE_CHECK_MEDIA");
+
+    test.run();
+  }, true);
+
+</script>
+</pre>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/dom/media/tests/mochitest/test_dataChannel_basicVideo.html
@@ -0,0 +1,28 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="application/javascript" src="head.js"></script>
+  <script type="application/javascript" src="pc.js"></script>
+  <script type="application/javascript" src="templates.js"></script>
+</head>
+<body>
+<pre id="test">
+<script type="application/javascript">
+  createHTML({
+    bug: "796889",
+    title: "Basic data channel video connection"
+  });
+
+  var test;
+  runTest(function () {
+    test = new DataChannelTest();
+    test.setMediaConstraints([{video: true}], [{video: true}]);
+    test.run();
+  }, true);
+
+</script>
+</pre>
+</body>
+</html>
--- a/dom/media/tests/mochitest/test_peerConnection_addCandidateInHaveLocalOffer.html
+++ b/dom/media/tests/mochitest/test_peerConnection_addCandidateInHaveLocalOffer.html
@@ -1,16 +1,17 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="head.js"></script>
   <script type="application/javascript" src="mediaStreamPlayback.js"></script>
   <script type="application/javascript" src="pc.js"></script>
+  <script type="application/javascript" src="templates.js"></script>
 </head>
 <body>
 <pre id="test">
 <script type="application/javascript">
   createHTML({
     bug: "784519",
     title: "addCandidate (answer) in 'have-local-offer'"
   });
--- a/dom/media/tests/mochitest/test_peerConnection_basicAudio.html
+++ b/dom/media/tests/mochitest/test_peerConnection_basicAudio.html
@@ -1,16 +1,17 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="head.js"></script>
   <script type="application/javascript" src="mediaStreamPlayback.js"></script>
   <script type="application/javascript" src="pc.js"></script>
+  <script type="application/javascript" src="templates.js"></script>
 </head>
 <body>
 <pre id="test">
 <script type="application/javascript">
   createHTML({
     bug: "796892",
     title: "Basic audio-only peer connection"
   });
--- a/dom/media/tests/mochitest/test_peerConnection_basicAudioVideo.html
+++ b/dom/media/tests/mochitest/test_peerConnection_basicAudioVideo.html
@@ -1,16 +1,17 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="head.js"></script>
   <script type="application/javascript" src="mediaStreamPlayback.js"></script>
   <script type="application/javascript" src="pc.js"></script>
+  <script type="application/javascript" src="templates.js"></script>
 </head>
 <body>
 <pre id="test">
 <script type="application/javascript">
 
   createHTML({
     bug: "796890",
     title: "Basic audio/video (separate) peer connection"
--- a/dom/media/tests/mochitest/test_peerConnection_basicAudioVideoCombined.html
+++ b/dom/media/tests/mochitest/test_peerConnection_basicAudioVideoCombined.html
@@ -1,29 +1,30 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="head.js"></script>
   <script type="application/javascript" src="mediaStreamPlayback.js"></script>
   <script type="application/javascript" src="pc.js"></script>
+  <script type="application/javascript" src="templates.js"></script>
 </head>
 <body>
 <pre id="test">
 <script type="application/javascript">
 
   createHTML({
     bug: "796890",
     title: "Basic audio/video (combined) peer connection"
   });
 
   var test;
   runTest(function () {
     test = new PeerConnectionTest();
-    test.setMediaConstraints([{audio: true}, {video: true}],
-                             [{audio: true}, {video: true}]);
+    test.setMediaConstraints([{audio: true, video: true}],
+                             [{audio: true, video: true}]);
     test.run();
   });
 </script>
 </pre>
 </body>
 </html>
--- a/dom/media/tests/mochitest/test_peerConnection_basicVideo.html
+++ b/dom/media/tests/mochitest/test_peerConnection_basicVideo.html
@@ -1,16 +1,17 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="head.js"></script>
   <script type="application/javascript" src="mediaStreamPlayback.js"></script>
   <script type="application/javascript" src="pc.js"></script>
+  <script type="application/javascript" src="templates.js"></script>
 </head>
 <body>
 <pre id="test">
 <script type="application/javascript">
   createHTML({
     bug: "796888",
     title: "Basic video-only peer connection"
   });
--- a/dom/media/tests/mochitest/test_peerConnection_bug827843.html
+++ b/dom/media/tests/mochitest/test_peerConnection_bug827843.html
@@ -1,15 +1,16 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="head.js"></script>
   <script type="application/javascript" src="pc.js"></script>
+  <script type="application/javascript" src="templates.js"></script>
 </head>
 <body>
 <pre id="test">
 <script type="application/javascript">
   createHTML({
     bug: "827843",
     title: "Ensure that localDescription and remoteDescription are null after close"
   });
--- a/dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveAudio.html
+++ b/dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveAudio.html
@@ -1,15 +1,16 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="head.js"></script>
   <script type="application/javascript" src="pc.js"></script>
+  <script type="application/javascript" src="templates.js"></script>
 </head>
 <body>
 <pre id="test">
 <script type="application/javascript">
   createHTML({
     bug: "850275",
     title: "Simple offer media constraint test with audio"
   });
--- a/dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveVideo.html
+++ b/dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveVideo.html
@@ -1,15 +1,16 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="head.js"></script>
   <script type="application/javascript" src="pc.js"></script>
+  <script type="application/javascript" src="templates.js"></script>
 </head>
 <body>
 <pre id="test">
 <script type="application/javascript">
   createHTML({
     bug: "850275",
     title: "Simple offer media constraint test with video"
   });
--- a/dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveVideoAudio.html
+++ b/dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveVideoAudio.html
@@ -1,15 +1,16 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="head.js"></script>
   <script type="application/javascript" src="pc.js"></script>
+  <script type="application/javascript" src="templates.js"></script>
 </head>
 <body>
 <pre id="test">
 <script type="application/javascript">
   createHTML({
     bug: "850275",
     title: "Simple offer media constraint test with video/audio"
   });
--- a/dom/media/tests/mochitest/test_peerConnection_setLocalAnswerInHaveLocalOffer.html
+++ b/dom/media/tests/mochitest/test_peerConnection_setLocalAnswerInHaveLocalOffer.html
@@ -1,16 +1,17 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="head.js"></script>
   <script type="application/javascript" src="mediaStreamPlayback.js"></script>
   <script type="application/javascript" src="pc.js"></script>
+  <script type="application/javascript" src="templates.js"></script>
 </head>
 <body>
 <pre id="test">
 <script type="application/javascript">
   createHTML({
     bug: "784519",
     title: "setLocalDescription (answer) in 'have-local-offer'"
   });
--- a/dom/media/tests/mochitest/test_peerConnection_setLocalAnswerInStable.html
+++ b/dom/media/tests/mochitest/test_peerConnection_setLocalAnswerInStable.html
@@ -1,16 +1,17 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="head.js"></script>
   <script type="application/javascript" src="mediaStreamPlayback.js"></script>
   <script type="application/javascript" src="pc.js"></script>
+  <script type="application/javascript" src="templates.js"></script>
 </head>
 <body>
 <pre id="test">
 <script type="application/javascript">
   createHTML({
     bug: "784519",
     title: "setLocalDescription (answer) in 'stable'"
   });
--- a/dom/media/tests/mochitest/test_peerConnection_setLocalOfferInHaveRemoteOffer.html
+++ b/dom/media/tests/mochitest/test_peerConnection_setLocalOfferInHaveRemoteOffer.html
@@ -1,16 +1,17 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="head.js"></script>
   <script type="application/javascript" src="mediaStreamPlayback.js"></script>
   <script type="application/javascript" src="pc.js"></script>
+  <script type="application/javascript" src="templates.js"></script>
 </head>
 <body>
 <pre id="test">
 <script type="application/javascript">
   createHTML({
     bug: "784519",
     title: "setLocalDescription (offer) in 'have-remote-offer'"
   });
--- a/dom/media/tests/mochitest/test_peerConnection_setRemoteAnswerInHaveRemoteOffer.html
+++ b/dom/media/tests/mochitest/test_peerConnection_setRemoteAnswerInHaveRemoteOffer.html
@@ -1,16 +1,17 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="head.js"></script>
   <script type="application/javascript" src="mediaStreamPlayback.js"></script>
   <script type="application/javascript" src="pc.js"></script>
+  <script type="application/javascript" src="templates.js"></script>
 </head>
 <body>
 <pre id="test">
 <script type="application/javascript">
   createHTML({
     bug: "784519",
     title: "setRemoteDescription (answer) in 'have-remote-offer'"
   });
--- a/dom/media/tests/mochitest/test_peerConnection_setRemoteAnswerInStable.html
+++ b/dom/media/tests/mochitest/test_peerConnection_setRemoteAnswerInStable.html
@@ -1,16 +1,17 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="head.js"></script>
   <script type="application/javascript" src="mediaStreamPlayback.js"></script>
   <script type="application/javascript" src="pc.js"></script>
+  <script type="application/javascript" src="templates.js"></script>
 </head>
 <body>
 <pre id="test">
 <script type="application/javascript">
   createHTML({
     bug: "784519",
     title: "setRemoteDescription (answer) in 'stable'"
   });
--- a/dom/media/tests/mochitest/test_peerConnection_setRemoteOfferInHaveLocalOffer.html
+++ b/dom/media/tests/mochitest/test_peerConnection_setRemoteOfferInHaveLocalOffer.html
@@ -1,16 +1,17 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="head.js"></script>
   <script type="application/javascript" src="mediaStreamPlayback.js"></script>
   <script type="application/javascript" src="pc.js"></script>
+  <script type="application/javascript" src="templates.js"></script>
 </head>
 <body>
 <pre id="test">
 <script type="application/javascript">
   createHTML({
     bug: "784519",
     title: "setRemoteDescription (offer) in 'have-local-offer'"
   });
--- a/gfx/layers/composite/AsyncCompositionManager.h
+++ b/gfx/layers/composite/AsyncCompositionManager.h
@@ -35,16 +35,24 @@ struct ViewTransform {
 
   operator gfx3DMatrix() const
   {
     return
       gfx3DMatrix::Translation(mTranslation.x, mTranslation.y, 0) *
       gfx3DMatrix::ScalingMatrix(mScale.scale, mScale.scale, 1);
   }
 
+  bool operator==(const ViewTransform& rhs) const {
+    return mTranslation == rhs.mTranslation && mScale == rhs.mScale;
+  }
+
+  bool operator!=(const ViewTransform& rhs) const {
+    return !(*this == rhs);
+  }
+
   LayerPoint mTranslation;
   LayoutDeviceToScreenScale mScale;
 };
 
 /**
  * Manage async composition effects. This class is only used with OMTC and only
  * lives on the compositor thread. It is a layer on top of the layer manager
  * (LayerManagerComposite) which deals with elements of composition which are
--- a/gfx/layers/ipc/AsyncPanZoomController.cpp
+++ b/gfx/layers/ipc/AsyncPanZoomController.cpp
@@ -101,16 +101,31 @@ static float gYSkateSizeMultiplier = 3.5
 /** The multiplier we apply to a dimension's length if it is stationary. We
  * prefer to increase the size of the Y axis because it is more natural in the
  * case that a user is reading a page that scrolls up/down. Note that one,
  * both or neither of these may be used at any instant.
  */
 static float gXStationarySizeMultiplier = 1.5f;
 static float gYStationarySizeMultiplier = 2.5f;
 
+static TimeStamp sFrameTime;
+
+static TimeStamp
+GetFrameTime() {
+  if (sFrameTime.IsNull()) {
+    return TimeStamp::Now();
+  }
+  return sFrameTime;
+}
+
+void
+AsyncPanZoomController::SetFrameTime(const TimeStamp& aTime) {
+  sFrameTime = aTime;
+}
+
 static void ReadAZPCPrefs()
 {
   Preferences::AddIntVarCache(&gPanRepaintInterval, "gfx.azpc.pan_repaint_interval", gPanRepaintInterval);
   Preferences::AddIntVarCache(&gFlingRepaintInterval, "gfx.azpc.fling_repaint_interval", gFlingRepaintInterval);
   Preferences::AddFloatVarCache(&gMinSkateSpeed, "gfx.azpc.min_skate_speed", gMinSkateSpeed);
   Preferences::AddIntVarCache(&gTouchListenerTimeout, "gfx.azpc.touch_listener_timeout", gTouchListenerTimeout);
   Preferences::AddIntVarCache(&gNumPaintDurationSamples, "gfx.azpc.num_paint_duration_samples", gNumPaintDurationSamples);
   Preferences::AddFloatVarCache(&gTouchStartTolerance, "gfx.azpc.touch_start_tolerance", gTouchStartTolerance);
@@ -149,20 +164,20 @@ AsyncPanZoomController::AsyncPanZoomCont
   :  mGeckoContentController(aGeckoContentController),
      mTouchListenerTimeoutTask(nullptr),
      mX(this),
      mY(this),
      mAllowZoom(true),
      mMinZoom(MIN_ZOOM),
      mMaxZoom(MAX_ZOOM),
      mMonitor("AsyncPanZoomController"),
-     mLastSampleTime(TimeStamp::Now()),
+     mLastSampleTime(GetFrameTime()),
      mState(NOTHING),
-     mPreviousPaintStartTime(TimeStamp::Now()),
-     mLastAsyncScrollTime(TimeStamp::Now()),
+     mPreviousPaintStartTime(GetFrameTime()),
+     mLastAsyncScrollTime(GetFrameTime()),
      mLastAsyncScrollOffset(0, 0),
      mCurrentAsyncScrollOffset(0, 0),
      mAsyncScrollTimeoutTask(nullptr),
      mAsyncScrollThrottleTime(100),
      mAsyncScrollTimeout(300),
      mDPI(72),
      mWaitingForContentToPaint(false),
      mDisableNextTouchBatch(false),
@@ -758,17 +773,17 @@ void AsyncPanZoomController::TrackTouch(
                                                           timeDelta));
     if (fabs(displacement.x) <= EPSILON && fabs(displacement.y) <= EPSILON) {
       return;
     }
 
     ScrollBy(CSSPoint::FromUnknownPoint(displacement));
     ScheduleComposite();
 
-    TimeDuration timePaintDelta = TimeStamp::Now() - mPreviousPaintStartTime;
+    TimeDuration timePaintDelta = GetFrameTime() - mPreviousPaintStartTime;
     if (timePaintDelta.ToMilliseconds() > gPanRepaintInterval) {
       RequestContentRepaint();
     }
   }
 }
 
 SingleTouchData& AsyncPanZoomController::GetFirstSingleTouch(const MultiTouchInput& aEvent) {
   return (SingleTouchData&)aEvent.mTouches[0];
@@ -795,37 +810,34 @@ bool AsyncPanZoomController::DoFling(con
   // We want to inversely scale it because when you're zoomed further in, a
   // larger swipe should move you a shorter distance.
   ScreenToCSSScale inverseResolution = CalculateResolution(mFrameMetrics).Inverse();
 
   ScrollBy(CSSPoint::FromUnknownPoint(gfx::Point(
     mX.GetDisplacementForDuration(inverseResolution.scale, aDelta),
     mY.GetDisplacementForDuration(inverseResolution.scale, aDelta)
   )));
-  TimeDuration timePaintDelta = TimeStamp::Now() - mPreviousPaintStartTime;
+  TimeDuration timePaintDelta = GetFrameTime() - mPreviousPaintStartTime;
   if (timePaintDelta.ToMilliseconds() > gFlingRepaintInterval) {
     RequestContentRepaint();
   }
 
   return true;
 }
 
 void AsyncPanZoomController::CancelAnimation() {
   mState = NOTHING;
 }
 
 void AsyncPanZoomController::SetCompositorParent(CompositorParent* aCompositorParent) {
   mCompositorParent = aCompositorParent;
 }
 
 void AsyncPanZoomController::ScrollBy(const CSSPoint& aOffset) {
-  CSSPoint newOffset = mFrameMetrics.mScrollOffset + aOffset;
-  FrameMetrics metrics(mFrameMetrics);
-  metrics.mScrollOffset = newOffset;
-  mFrameMetrics = metrics;
+  mFrameMetrics.mScrollOffset += aOffset;
 }
 
 void AsyncPanZoomController::ScaleWithFocus(float aZoom,
                                             const ScreenPoint& aFocus) {
   float zoomFactor = aZoom / mFrameMetrics.mZoom.scale;
   CSSToScreenScale resolution = CalculateResolution(mFrameMetrics);
 
   SetZoomAndResolution(ScreenToScreenScale(aZoom));
@@ -989,17 +1001,17 @@ int AsyncPanZoomController::GetDPI() {
 
 void AsyncPanZoomController::ScheduleComposite() {
   if (mCompositorParent) {
     mCompositorParent->ScheduleRenderOnCompositorThread();
   }
 }
 
 void AsyncPanZoomController::RequestContentRepaint() {
-  mPreviousPaintStartTime = TimeStamp::Now();
+  mPreviousPaintStartTime = GetFrameTime();
 
   double estimatedPaintSum = 0.0;
   for (uint32_t i = 0; i < mPreviousPaintDurations.Length(); i++) {
     estimatedPaintSum += mPreviousPaintDurations[i].ToSeconds();
   }
 
   double estimatedPaintDuration = 0.0;
   if (estimatedPaintSum > EPSILON) {
@@ -1194,17 +1206,17 @@ void AsyncPanZoomController::NotifyLayer
   if (mWaitingForContentToPaint) {
     // Remove the oldest sample we have if adding a new sample takes us over our
     // desired number of samples.
     if (mPreviousPaintDurations.Length() >= gNumPaintDurationSamples) {
       mPreviousPaintDurations.RemoveElementAt(0);
     }
 
     mPreviousPaintDurations.AppendElement(
-      TimeStamp::Now() - mPreviousPaintStartTime);
+      GetFrameTime() - mPreviousPaintStartTime);
   } else {
     // No paint was requested, but we got one anyways. One possible cause of this
     // is that content could have fired a scrollTo(). In this case, we should take
     // the new scroll offset. Document/viewport changes are handled elsewhere.
     // Also note that, since NotifyLayersUpdated() is called whenever there's a
     // layers update, we didn't necessarily get a new scroll offset, but we're
     // updating our local copy of it anyways just in case.
     switch (mState) {
@@ -1361,17 +1373,17 @@ void AsyncPanZoomController::ZoomToRect(
     if (zoomToRect.x + rectAfterZoom.width > cssPageRect.width) {
       zoomToRect.x = cssPageRect.width - rectAfterZoom.width;
       zoomToRect.x = zoomToRect.x > 0 ? zoomToRect.x : 0;
     }
 
     mStartZoomToMetrics = mFrameMetrics;
     mEndZoomToMetrics.mScrollOffset = zoomToRect.TopLeft();
 
-    mAnimationStartTime = TimeStamp::Now();
+    mAnimationStartTime = GetFrameTime();
 
     ScheduleComposite();
   }
 }
 
 void AsyncPanZoomController::ContentReceivedTouch(bool aPreventDefault) {
   if (!mFrameMetrics.mMayHaveTouchListeners && !mDelayPanning) {
     mTouchQueue.Clear();
--- a/gfx/layers/ipc/AsyncPanZoomController.h
+++ b/gfx/layers/ipc/AsyncPanZoomController.h
@@ -246,16 +246,23 @@ public:
   void SendAsyncScrollEvent();
 
   /**
    * Handler for events which should not be intercepted by the touch listener.
    * Does the work for ReceiveInputEvent().
    */
   nsEventStatus HandleInputEvent(const InputData& aEvent);
 
+  /**
+   * Sync panning and zooming animation using a fixed frame time.
+   * This will ensure that we animate the APZC correctly with other external
+   * animations to the same timestamp.
+   */
+  static void SetFrameTime(const TimeStamp& aMilliseconds);
+
 protected:
   /**
    * Helper method for touches beginning. Sets everything up for panning and any
    * multitouch gestures.
    */
   nsEventStatus OnTouchStart(const MultiTouchInput& aEvent);
 
   /**
--- a/gfx/src/nsRegion.cpp
+++ b/gfx/src/nsRegion.cpp
@@ -191,16 +191,22 @@ mozilla::ThreadLocal<RgnRectMemoryAlloca
 void RgnRectMemoryAllocatorDTOR(void *priv)
 {
   RgnRectMemoryAllocator* allocator = gRectPoolTlsIndex.get();
   delete allocator;
 }
 
 nsresult nsRegion::InitStatic()
 {
+  if (gRectPoolTlsIndex.initialized()) {
+    // It's ok to call InitStatic if we called ShutdownStatic first
+    MOZ_ASSERT(gRectPoolTlsIndex.get() == nullptr);
+    return NS_OK;
+  }
+
   return gRectPoolTlsIndex.init() ? NS_OK : NS_ERROR_FAILURE;
 }
 
 void nsRegion::ShutdownStatic()
 {
   RgnRectMemoryAllocator* allocator = gRectPoolTlsIndex.get();
   if (!allocator)
     return;
--- a/gfx/tests/gtest/Makefile.in
+++ b/gfx/tests/gtest/Makefile.in
@@ -21,23 +21,25 @@ LOCAL_INCLUDES = \
   -I$(topsrcdir)/gfx/layers \
   -I$(topsrcdir)/gfx/2d \
   -I$(topsrcdir)/gfx/2d/unittest \
   $(NULL)
 
 GTEST_CPPSRCS = \
   TestLayers.cpp \
   TestTiledLayerBuffer.cpp \
+  TestAsyncPanZoomController.cpp \
   $(NULL)
 
 # Because of gkmedia on windows we wont find these
 # symbols in xul.dll.
 ifneq ($(MOZ_WIDGET_TOOLKIT),windows)
 GTEST_CPPSRCS += \
   TestMoz2D.cpp \
   TestBase.cpp \
   TestPoint.cpp \
   TestScaling.cpp \
   $(NULL)
 endif
 
 include $(topsrcdir)/config/rules.mk
+include $(topsrcdir)/ipc/chromium/chromium-config.mk
 
new file mode 100644
--- /dev/null
+++ b/gfx/tests/gtest/TestAsyncPanZoomController.cpp
@@ -0,0 +1,196 @@
+/* vim:set ts=2 sw=2 sts=2 et: */
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/
+ */
+
+#include "gtest/gtest.h"
+#include "gmock/gmock.h"
+
+#include "mozilla/layers/AsyncCompositionManager.h" // for ViewTransform
+#include "mozilla/layers/AsyncPanZoomController.h"
+#include "mozilla/layers/LayerManagerComposite.h"
+#include "mozilla/layers/GeckoContentController.h"
+#include "Layers.h"
+
+using namespace mozilla;
+using namespace mozilla::gfx;
+using namespace mozilla::layers;
+using ::testing::_;
+
+class MockContentController : public GeckoContentController {
+public:
+  MOCK_METHOD1(RequestContentRepaint, void(const FrameMetrics&));
+  MOCK_METHOD1(HandleDoubleTap, void(const CSSIntPoint&));
+  MOCK_METHOD1(HandleSingleTap, void(const CSSIntPoint&));
+  MOCK_METHOD1(HandleLongTap, void(const CSSIntPoint&));
+  MOCK_METHOD2(SendAsyncScrollDOMEvent, void(const CSSRect &aContentRect, const CSSSize &aScrollableSize));
+  MOCK_METHOD2(PostDelayedTask, void(Task* aTask, int aDelayMs));
+};
+
+class TestContainerLayer : public ContainerLayer {
+  public:
+    TestContainerLayer()
+      : ContainerLayer(nullptr, nullptr)
+    {}
+  void RemoveChild(Layer* aChild) {}
+  void InsertAfter(Layer* aChild, Layer* aAfter) {}
+  void ComputeEffectiveTransforms(const gfx3DMatrix& aTransformToSurface) {}
+  void RepositionChild(Layer* aChild, Layer* aAfter) {}
+};
+
+static
+FrameMetrics TestFrameMetrics() {
+  FrameMetrics fm;
+
+  fm.mDisplayPort = CSSRect(0, 0, 10, 10);
+  fm.mCompositionBounds = ScreenIntRect(0, 0, 10, 10);
+  fm.mCriticalDisplayPort = CSSRect(0, 0, 10, 10);
+  fm.mScrollableRect = CSSRect(0, 0, 100, 100);
+  fm.mViewport = CSSRect(0, 0, 10, 10);
+
+  return fm;
+}
+
+static
+void ApzcPan(AsyncPanZoomController* apzc, int& aTime, int aTouchStartY, int aTouchEndY) {
+
+  const int TIME_BETWEEN_TOUCH_EVENT = 100;
+  const int OVERCOME_TOUCH_TOLERANCE = 100;
+  MultiTouchInput mti;
+  nsEventStatus status;
+
+  mti = MultiTouchInput(MultiTouchInput::MULTITOUCH_START, aTime);
+  aTime += TIME_BETWEEN_TOUCH_EVENT;
+  // Make sure the move is large enough to not be handled as a tap
+  mti.mTouches.AppendElement(SingleTouchData(0, ScreenIntPoint(10, aTouchStartY+OVERCOME_TOUCH_TOLERANCE), ScreenSize(0, 0), 0, 0));
+  status = apzc->HandleInputEvent(mti);
+  EXPECT_EQ(status, nsEventStatus_eConsumeNoDefault);
+  // APZC should be in TOUCHING state
+
+  mti = MultiTouchInput(MultiTouchInput::MULTITOUCH_MOVE, aTime);
+  aTime += TIME_BETWEEN_TOUCH_EVENT;
+  mti.mTouches.AppendElement(SingleTouchData(0, ScreenIntPoint(10, aTouchStartY), ScreenSize(0, 0), 0, 0));
+  status = apzc->HandleInputEvent(mti);
+  EXPECT_EQ(status, nsEventStatus_eConsumeNoDefault);
+  // APZC should be in PANNING, otherwise status != ConsumeNoDefault
+
+  mti = MultiTouchInput(MultiTouchInput::MULTITOUCH_MOVE, aTime);
+  aTime += TIME_BETWEEN_TOUCH_EVENT;
+  mti.mTouches.AppendElement(SingleTouchData(0, ScreenIntPoint(10, aTouchEndY), ScreenSize(0, 0), 0, 0));
+  status = apzc->HandleInputEvent(mti);
+  EXPECT_EQ(status, nsEventStatus_eConsumeNoDefault);
+
+  mti = MultiTouchInput(MultiTouchInput::MULTITOUCH_END, aTime);
+  aTime += TIME_BETWEEN_TOUCH_EVENT;
+  mti.mTouches.AppendElement(SingleTouchData(0, ScreenIntPoint(10, aTouchEndY), ScreenSize(0, 0), 0, 0));
+  status = apzc->HandleInputEvent(mti);
+}
+
+TEST(AsyncPanZoomController, Constructor) {
+  // RefCounted class can't live in the stack
+  nsRefPtr<MockContentController> mcc = new MockContentController();
+  nsRefPtr<AsyncPanZoomController> apzc = new AsyncPanZoomController(mcc);
+  apzc->NotifyLayersUpdated(TestFrameMetrics(), true);
+}
+
+TEST(AsyncPanZoomController, SimpleTransform) {
+  TimeStamp testStartTime = TimeStamp::Now();
+  // RefCounted class can't live in the stack
+  nsRefPtr<MockContentController> mcc = new MockContentController();
+  nsRefPtr<AsyncPanZoomController> apzc = new AsyncPanZoomController(mcc);
+  apzc->NotifyLayersUpdated(TestFrameMetrics(), true);
+
+  TestContainerLayer layer;
+  ScreenPoint pointOut;
+  ViewTransform viewTransformOut;
+  apzc->SampleContentTransformForFrame(testStartTime, &layer, &viewTransformOut, pointOut);
+
+  EXPECT_EQ(pointOut, ScreenPoint());
+  EXPECT_EQ(viewTransformOut, ViewTransform());
+}
+
+TEST(AsyncPanZoomController, Pan) {
+  TimeStamp testStartTime = TimeStamp::Now();
+  AsyncPanZoomController::SetFrameTime(testStartTime);
+
+  nsRefPtr<MockContentController> mcc = new MockContentController();
+  nsRefPtr<AsyncPanZoomController> apzc = new AsyncPanZoomController(mcc);
+  apzc->NotifyLayersUpdated(TestFrameMetrics(), true);
+
+  EXPECT_CALL(*mcc, SendAsyncScrollDOMEvent(_,_)).Times(4);
+  EXPECT_CALL(*mcc, RequestContentRepaint(_)).Times(1);
+
+  int time = 0;
+  int touchStart = 50;
+  int touchEnd = 10;
+  TestContainerLayer layer;
+  ScreenPoint pointOut;
+  ViewTransform viewTransformOut;
+
+  // Pan down
+  ApzcPan(apzc, time, touchStart, touchEnd);
+  apzc->SampleContentTransformForFrame(testStartTime, &layer, &viewTransformOut, pointOut);
+  EXPECT_EQ(pointOut, ScreenPoint(0, -(touchEnd-touchStart)));
+  EXPECT_NE(viewTransformOut, ViewTransform());
+
+  // Pan back
+  ApzcPan(apzc, time, touchEnd, touchStart);
+  apzc->SampleContentTransformForFrame(testStartTime, &layer, &viewTransformOut, pointOut);
+  EXPECT_EQ(pointOut, ScreenPoint());
+  EXPECT_EQ(viewTransformOut, ViewTransform());
+}
+
+TEST(AsyncPanZoomController, Fling) {
+  TimeStamp testStartTime = TimeStamp::Now();
+  AsyncPanZoomController::SetFrameTime(testStartTime);
+
+  nsRefPtr<MockContentController> mcc = new MockContentController();
+  nsRefPtr<AsyncPanZoomController> apzc = new AsyncPanZoomController(mcc);
+  apzc->NotifyLayersUpdated(TestFrameMetrics(), true);
+
+  EXPECT_CALL(*mcc, SendAsyncScrollDOMEvent(_,_)).Times(2);
+  EXPECT_CALL(*mcc, RequestContentRepaint(_)).Times(1);
+
+  int time = 0;
+  int touchStart = 50;
+  int touchEnd = 10;
+  TestContainerLayer layer;
+  ScreenPoint pointOut;
+  ViewTransform viewTransformOut;
+
+  // Fling down. Each step scroll further down
+  ApzcPan(apzc, time, touchStart, touchEnd);
+  ScreenPoint lastPoint;
+  for (int i = 1; i < 50; i+=1) {
+    apzc->SampleContentTransformForFrame(testStartTime+TimeDuration::FromMilliseconds(i), &layer, &viewTransformOut, pointOut);
+    printf("Time %f, y position %f\n", (float)i, pointOut.y);
+    EXPECT_GT(pointOut.y, lastPoint.y);
+    lastPoint = pointOut;
+  }
+}
+
+TEST(AsyncPanZoomController, OverScrollPanning) {
+  TimeStamp testStartTime = TimeStamp::Now();
+  AsyncPanZoomController::SetFrameTime(testStartTime);
+
+  nsRefPtr<MockContentController> mcc = new MockContentController();
+  nsRefPtr<AsyncPanZoomController> apzc = new AsyncPanZoomController(mcc);
+  apzc->NotifyLayersUpdated(TestFrameMetrics(), true);
+
+  EXPECT_CALL(*mcc, SendAsyncScrollDOMEvent(_,_)).Times(3);
+  EXPECT_CALL(*mcc, RequestContentRepaint(_)).Times(1);
+
+  // Pan sufficiently to hit overscroll behavior
+  int time = 0;
+  int touchStart = 500;
+  int touchEnd = 10;
+  TestContainerLayer layer;
+  ScreenPoint pointOut;
+  ViewTransform viewTransformOut;
+
+  // Pan down
+  ApzcPan(apzc, time, touchStart, touchEnd);
+  apzc->SampleContentTransformForFrame(testStartTime+TimeDuration::FromMilliseconds(1000), &layer, &viewTransformOut, pointOut);
+  EXPECT_EQ(pointOut, ScreenPoint(0, 90));
+}
+
--- a/gfx/tests/gtest/TestMoz2D.cpp
+++ b/gfx/tests/gtest/TestMoz2D.cpp
@@ -6,22 +6,22 @@
 #include "gtest/gtest.h"
 #include "TestBase.h"
 #include "TestPoint.h"
 #include "TestScaling.h"
 
 TEST(Moz2D, Point) {
   TestBase* test = new TestPoint();
   int failures = 0;
-  int totalTests = test->RunTests(&failures);
+  test->RunTests(&failures);
   delete test;
 
   ASSERT_EQ(failures, 0);
 }
 
 TEST(Moz2D, Scaling) {
   TestBase* test = new TestScaling();
   int failures = 0;
-  int totalTests = test->RunTests(&failures);
+  test->RunTests(&failures);
   delete test;
 
   ASSERT_EQ(failures, 0);
 }
--- a/image/src/SVGDocumentWrapper.cpp
+++ b/image/src/SVGDocumentWrapper.cpp
@@ -7,17 +7,16 @@
 
 #include "mozilla/dom/Element.h"
 #include "nsIAtom.h"
 #include "nsICategoryManager.h"
 #include "nsIChannel.h"
 #include "nsIContentViewer.h"
 #include "nsIDocument.h"
 #include "nsIDocumentLoaderFactory.h"
-#include "nsIDOMSVGAnimatedLength.h"
 #include "nsIDOMSVGLength.h"
 #include "nsIHttpChannel.h"
 #include "nsIObserverService.h"
 #include "nsIParser.h"
 #include "nsIPresShell.h"
 #include "nsIRequest.h"
 #include "nsIStreamListener.h"
 #include "nsIXMLContentSink.h"
@@ -81,24 +80,22 @@ SVGDocumentWrapper::GetWidthOrHeight(Dim
     domAnimLength = rootElem->Width();
   } else {
     NS_ABORT_IF_FALSE(aDimension == eHeight, "invalid dimension");
     domAnimLength = rootElem->Height();
   }
   NS_ENSURE_TRUE(domAnimLength, false);
 
   // Get the animated value from the object
-  nsRefPtr<nsIDOMSVGLength> domLength;
-  nsresult rv = domAnimLength->GetAnimVal(getter_AddRefs(domLength));
-  NS_ENSURE_SUCCESS(rv, false);
+  nsRefPtr<nsIDOMSVGLength> domLength = domAnimLength->AnimVal();
   NS_ENSURE_TRUE(domLength, false);
 
   // Check if it's a percent value (and fail if so)
   uint16_t unitType;
-  rv = domLength->GetUnitType(&unitType);
+  nsresult rv = domLength->GetUnitType(&unitType);
   NS_ENSURE_SUCCESS(rv, false);
   if (unitType == nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE) {
     return false;
   }
 
   // Non-percent value - woot! Grab it & return it.
   float floatLength;
   rv = domLength->GetValue(&floatLength);
--- a/js/src/builtin/TestingFunctions.cpp
+++ b/js/src/builtin/TestingFunctions.cpp
@@ -902,28 +902,29 @@ js::testingFunc_inParallelSection(JSCont
     // would be inlined to TRUE in ion-generated code.
     JS_ASSERT(!InParallelSection());
     JS_SET_RVAL(cx, vp, JSVAL_FALSE);
     return true;
 }
 
 static JSObject *objectMetadataFunction = NULL;
 
-static JSObject *
-ShellObjectMetadataCallback(JSContext *cx)
+static bool
+ShellObjectMetadataCallback(JSContext *cx, JSObject **pmetadata)
 {
     Value thisv = UndefinedValue();
 
     RootedValue rval(cx);
-    if (!Invoke(cx, thisv, ObjectValue(*objectMetadataFunction), 0, NULL, rval.address())) {
-        cx->clearPendingException();
-        return NULL;
-    }
+    if (!Invoke(cx, thisv, ObjectValue(*objectMetadataFunction), 0, NULL, rval.address()))
+        return false;
 
-    return rval.isObject() ? &rval.toObject() : NULL;
+    if (rval.isObject())
+        *pmetadata = &rval.toObject();
+
+    return true;
 }
 
 static JSBool
 SetObjectMetadataCallback(JSContext *cx, unsigned argc, jsval *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     args.rval().setUndefined();
--- a/js/src/config/rules.mk
+++ b/js/src/config/rules.mk
@@ -1177,33 +1177,24 @@ ifeq ($(OS_ARCH),OS2)
 else
 ifdef GNU_CC
 	$(RC) $(RCFLAGS) $(filter-out -U%,$(DEFINES)) $(INCLUDES:-I%=--include-dir %) $(OUTOPTION)$@ $(_VPATH_SRCS)
 else
 	$(RC) $(RCFLAGS) -r $(DEFINES) $(INCLUDES) $(OUTOPTION)$@ $(_VPATH_SRCS)
 endif
 endif
 
-# need 3 separate lines for OS/2
-%:: %.pl
-	$(RM) $@
-	cp $< $@
-	chmod +x $@
-
-%:: %.sh
-	$(RM) $@
-	cp $< $@
-	chmod +x $@
-
 # Cancel these implicit rules
 #
 %: %,v
 
 %: RCS/%,v
 
+%: RCS/%
+
 %: s.%
 
 %: SCCS/s.%
 
 ###############################################################################
 # Java rules
 ###############################################################################
 ifneq (,$(filter OS2 WINNT,$(OS_ARCH)))
--- a/js/src/frontend/Parser.cpp
+++ b/js/src/frontend/Parser.cpp
@@ -2313,44 +2313,45 @@ Parser<SyntaxParseHandler>::moduleDecl()
     return SyntaxParseHandler::NodeFailure;
 }
 
 template <typename ParseHandler>
 typename ParseHandler::Node
 Parser<ParseHandler>::functionStmt()
 {
     JS_ASSERT(tokenStream.currentToken().type == TOK_FUNCTION);
+
+    TokenStream::Position start(keepAtoms);
+    tokenStream.tell(&start);
+
     RootedPropertyName name(context);
     if (tokenStream.getToken(TSF_KEYWORD_IS_NAME) == TOK_NAME) {
         name = tokenStream.currentToken().name();
     } else {
         /* Unnamed function expressions are forbidden in statement context. */
         report(ParseError, false, null(), JSMSG_UNNAMED_FUNCTION_STMT);
         return null();
     }
 
-    TokenStream::Position start(keepAtoms);
-    tokenStream.positionAfterLastFunctionKeyword(start);
-
     /* We forbid function statements in strict mode code. */
     if (!pc->atBodyLevel() && pc->sc->needStrictChecks() &&
         !report(ParseStrictError, pc->sc->strict, null(), JSMSG_STRICT_FUNCTION_STATEMENT))
         return null();
 
     return functionDef(name, start, tokenStream.positionToOffset(start), Normal, Statement);
 }
 
 template <typename ParseHandler>
 typename ParseHandler::Node
 Parser<ParseHandler>::functionExpr()
 {
     RootedPropertyName name(context);
     JS_ASSERT(tokenStream.currentToken().type == TOK_FUNCTION);
     TokenStream::Position start(keepAtoms);
-    tokenStream.positionAfterLastFunctionKeyword(start);
+    tokenStream.tell(&start);
     if (tokenStream.getToken(TSF_KEYWORD_IS_NAME) == TOK_NAME)
         name = tokenStream.currentToken().name();
     else
         tokenStream.ungetToken();
     return functionDef(name, start, tokenStream.positionToOffset(start), Normal, Expression);
 }
 
 /*
@@ -2747,26 +2748,22 @@ Parser<ParseHandler>::bindVarOrConst(JSC
         parser->handler.setFlag(pn, PND_DEOPTIMIZED);
         if (pc->sc->isFunctionBox()) {
             FunctionBox *funbox = pc->sc->asFunctionBox();
             funbox->setMightAliasLocals();
 
             /*
              * This definition isn't being added to the parse context's
              * declarations, so make sure to indicate the need to deoptimize
-             * the script's arguments object.
+             * the script's arguments object. Mark the function as if it
+             * contained a debugger statement, which will deoptimize arguments
+             * as much as possible.
              */
-            HandlePropertyName arguments = cx->names().arguments;
-            if (name == arguments) {
-                Node pn = parser->newName(arguments);
-                if (!pc->define(parser->context, arguments, pn, Definition::VAR))
-                    return false;
-                funbox->setArgumentsHasLocalBinding();
-                funbox->setDefinitelyNeedsArgsObj();
-            }
+            if (name == cx->names().arguments)
+                funbox->setHasDebuggerStatement();
         }
         return true;
     }
 
     DefinitionList::Range defs = pc->decls().lookupMulti(name);
     JS_ASSERT_IF(stmt, !defs.empty());
 
     if (defs.empty())
--- a/js/src/frontend/SharedContext.h
+++ b/js/src/frontend/SharedContext.h
@@ -33,17 +33,17 @@ class AnyContextFlags
     bool            hasExplicitUseStrict:1;
 
     // The (static) bindings of this script need to support dynamic name
     // read/write access. Here, 'dynamic' means dynamic dictionary lookup on
     // the scope chain for a dynamic set of keys. The primary examples are:
     //  - direct eval
     //  - function::
     //  - with
-    // since both effectively allow any name to be accessed. Non-exmaples are:
+    // since both effectively allow any name to be accessed. Non-examples are:
     //  - upvars of nested functions
     //  - function statement
     // since the set of assigned name is known dynamically. 'with' could be in
     // the non-example category, provided the set of all free variables within
     // the with block was noted. However, we do not optimize 'with' so, for
     // simplicity, 'with' is treated like eval.
     //
     // Note: access through the arguments object is not considered dynamic
--- a/js/src/frontend/TokenStream.cpp
+++ b/js/src/frontend/TokenStream.cpp
@@ -279,17 +279,16 @@ TokenStream::TokenStream(JSContext *cx, 
     sourceMap(NULL),
     listenerTSData(),
     tokenbuf(cx),
     version(options.version),
     cx(cx),
     originPrincipals(JSScript::normalizeOriginPrincipals(options.principals,
                                                          options.originPrincipals)),
     strictModeGetter(smg),
-    lastFunctionKeyword(keepAtoms),
     tokenSkip(cx, &tokens),
     linebaseSkip(cx, &linebase),
     prevLinebaseSkip(cx, &prevLinebase)
 {
     // Column numbers are computed as offsets from the current line's base, so the
     // initial line's base must be included in the buffer. linebase and userbuf
     // were adjusted above, and if we are starting tokenization part way through
     // this line then adjust the next character.
@@ -569,27 +568,19 @@ TokenStream::seek(const Position &pos)
     for (unsigned i = 0; i < lookahead; i++)
         tokens[(cursor + 1 + i) & ntokensMask] = pos.lookaheadTokens[i];
 }
 
 void
 TokenStream::seek(const Position &pos, const TokenStream &other)
 {
     srcCoords.fill(other.srcCoords);
-    lastFunctionKeyword = other.lastFunctionKeyword;
     seek(pos);
 }
 
-void
-TokenStream::positionAfterLastFunctionKeyword(Position &pos)
-{
-    JS_ASSERT(lastFunctionKeyword.buf > userbuf.base());
-    PodAssign(&pos, &lastFunctionKeyword);
-}
-
 bool
 TokenStream::reportStrictModeErrorNumberVA(uint32_t offset, bool strictMode, unsigned errorNumber,
                                            va_list args)
 {
     /* In strict mode code, this is an error, not merely a warning. */
     unsigned flags = JSREPORT_STRICT;
     if (strictMode)
         flags |= JSREPORT_ERROR;
@@ -1167,21 +1158,18 @@ TokenStream::getTokenInternal()
                 length = tokenbuf.length();
             } else {
                 chars = identStart;
                 length = userbuf.addressOfNextRawChar() - identStart;
             }
             tt = TOK_NAME;
             if (!checkForKeyword(chars, length, &tt, &tp->t_op))
                 goto error;
-            if (tt != TOK_NAME) {
-                if (tt == TOK_FUNCTION)
-                    tell(&lastFunctionKeyword);
+            if (tt != TOK_NAME)
                 goto out;
-            }
         }
 
         /*
          * Identifiers containing no Unicode escapes can be atomized directly
          * from userbuf.  The rest must use the escapes converted via
          * tokenbuf before atomizing.
          */
         JSAtom *atom;
--- a/js/src/frontend/TokenStream.h
+++ b/js/src/frontend/TokenStream.h
@@ -655,17 +655,16 @@ class MOZ_STACK_CLASS TokenStream
         unsigned lookahead;
         Token lookaheadTokens[maxLookahead];
     };
 
     void advance(size_t position);
     void tell(Position *);
     void seek(const Position &pos);
     void seek(const Position &pos, const TokenStream &other);
-    void positionAfterLastFunctionKeyword(Position &pos);
 
     size_t positionToOffset(const Position &pos) const {
         return pos.buf - userbuf.base();
     }
 
     bool hasSourceMap() const {
         return sourceMap != NULL;
     }
@@ -915,17 +914,16 @@ class MOZ_STACK_CLASS TokenStream
     CharBuffer          tokenbuf;       /* current token string buffer */
     int8_t              oneCharTokens[128];  /* table of one-char tokens */
     bool                maybeEOL[256];       /* probabilistic EOL lookup table */
     bool                maybeStrSpecial[256];/* speeds up string scanning */
     JSVersion           version;        /* (i.e. to identify keywords) */
     JSContext           *const cx;
     JSPrincipals        *const originPrincipals;
     StrictModeGetter    *strictModeGetter; /* used to test for strict mode */
-    Position            lastFunctionKeyword; /* used as a starting point for reparsing strict functions */
 
     /*
      * The tokens array stores pointers to JSAtoms. These are rooted by the
      * atoms table using AutoKeepAtoms in the Parser. This SkipRoot tells the
      * exact rooting analysis to ignore the atoms in the tokens array.
      */
     SkipRoot            tokenSkip;
 
--- a/js/src/ion/IonAnalysis.cpp
+++ b/js/src/ion/IonAnalysis.cpp
@@ -782,18 +782,19 @@ ion::BuildDominatorTree(MIRGraph &graph)
         }
     }
     // Starting from each self-dominating block, traverse the CFG in pre-order.
     while (!worklist.empty()) {
         MBasicBlock *block = worklist.popCopy();
         block->setDomIndex(index);
 
         if (!worklist.append(block->immediatelyDominatedBlocksBegin(),
-                             block->immediatelyDominatedBlocksEnd()))
+                             block->immediatelyDominatedBlocksEnd())) {
             return false;
+        }
         index++;
     }
 
     return true;
 }
 
 bool
 ion::BuildPhiReverseMapping(MIRGraph &graph)
@@ -1353,18 +1354,19 @@ ion::EliminateRedundantChecks(MIRGraph &
     }
 
     // Starting from each self-dominating block, traverse the CFG in pre-order.
     while (!worklist.empty()) {
         MBasicBlock *block = worklist.popCopy();
 
         // Add all immediate dominators to the front of the worklist.
         if (!worklist.append(block->immediatelyDominatedBlocksBegin(),
-                             block->immediatelyDominatedBlocksEnd()))
+                             block->immediatelyDominatedBlocksEnd())) {
             return false;
+        }
 
         for (MDefinitionIterator iter(block); iter; ) {
             bool eliminated = false;
 
             if (iter->isBoundsCheck()) {
                 if (!TryEliminateBoundsCheck(checks, index, iter->toBoundsCheck(), &eliminated))
                     return false;
             } else if (iter->isTypeBarrier()) {
--- a/js/src/ion/IonBuilder.cpp
+++ b/js/src/ion/IonBuilder.cpp
@@ -192,28 +192,33 @@ IonBuilder::getPolyCallTargets(types::St
             if (obj->as<JSFunction>().isInterpreted() &&
                 !obj->as<JSFunction>().getOrCreateScript(cx))
             {
                 return false;
             }
             DebugOnly<bool> appendOk = targets.append(obj);
             JS_ASSERT(appendOk);
         } else {
+            /* Temporarily disable heavyweight-function inlining. */
+            targets.clear();
+            return true;
+#if 0
             types::TypeObject *typeObj = calleeTypes->getTypeObject(i);
             JS_ASSERT(typeObj);
             if (!typeObj->isFunction() || !typeObj->interpretedFunction) {
                 targets.clear();
                 return true;
             }
             if (!typeObj->interpretedFunction->getOrCreateScript(cx))
                 return false;
             DebugOnly<bool> appendOk = targets.append(typeObj->interpretedFunction);
             JS_ASSERT(appendOk);
 
             *gotLambda = true;
+#endif
         }
     }
 
     // For now, only inline "singleton" lambda calls
     if (*gotLambda && targets.length() > 1)
         targets.clear();
 
     return true;
--- a/js/src/ion/IonMacroAssembler.cpp
+++ b/js/src/ion/IonMacroAssembler.cpp
@@ -712,17 +712,20 @@ MacroAssembler::performOsr()
         // Not a function - just tag the calleeToken now.
         orPtr(Imm32(CalleeToken_Script), calleeToken);
         jump(&performOsr);
     }
 
     bind(&isFunction);
     {
         // Function - create the callee token, then get the script.
-        orPtr(Imm32(CalleeToken_Function), calleeToken);
+
+        // Skip the or-ing of CalleeToken_Function into calleeToken since it is zero.
+        JS_ASSERT(CalleeToken_Function == 0);
+
         loadPtr(Address(script, JSFunction::offsetOfNativeOrScript()), script);
     }
 
     bind(&performOsr);
 
     const Register ionScript = regs.takeAny();
     const Register osrEntry = regs.takeAny();
 
--- a/js/src/ion/MIR.cpp
+++ b/js/src/ion/MIR.cpp
@@ -224,21 +224,19 @@ MTest::foldsTo(bool useValueNumbers)
 
     return this;
 }
 
 void
 MDefinition::printOpcode(FILE *fp)
 {
     PrintOpcodeName(fp, op());
-    fprintf(fp, " ");
     for (size_t j = 0; j < numOperands(); j++) {
+        fprintf(fp, " ");
         getOperand(j)->printName(fp);
-        if (j != numOperands() - 1)
-            fprintf(fp, " ");
     }
 }
 
 size_t
 MDefinition::useCount() const
 {
     size_t count = 0;
     for (MUseIterator i(uses_.begin()); i != uses_.end(); i++)
@@ -440,16 +438,31 @@ MConstant::printOpcode(FILE *fp)
         break;
       default:
         JS_NOT_REACHED("unexpected type");
         break;
     }
 }
 
 void
+MControlInstruction::printOpcode(FILE *fp)
+{
+    MDefinition::printOpcode(fp);
+    for (size_t j = 0; j < numSuccessors(); j++)
+        fprintf(fp, " block%d", getSuccessor(j)->id());
+}
+
+void
+MCompare::printOpcode(FILE *fp)
+{
+    MDefinition::printOpcode(fp);
+    fprintf(fp, " %s", js_CodeName[jsop()]);
+}
+
+void
 MConstantElements::printOpcode(FILE *fp)
 {
     PrintOpcodeName(fp, op());
     fprintf(fp, " %p", value());
 }
 
 MParameter *
 MParameter::New(int32_t index, types::StackTypeSet *types)
--- a/js/src/ion/MIR.h
+++ b/js/src/ion/MIR.h
@@ -809,16 +809,18 @@ class MControlInstruction : public MInst
 
     virtual size_t numSuccessors() const = 0;
     virtual MBasicBlock *getSuccessor(size_t i) const = 0;
     virtual void replaceSuccessor(size_t i, MBasicBlock *successor) = 0;
 
     bool isControlInstruction() const {
         return true;
     }
+
+    void printOpcode(FILE *fp);
 };
 
 class MTableSwitch
   : public MControlInstruction
 {
     // The successors of the tableswitch
     // - First successor = the default case
     // - Successor 2 and higher = the cases sorted on case index.
@@ -1902,16 +1904,18 @@ class MCompare
         if (jsop_ == JSOP_STRICTEQ || jsop_ == JSOP_STRICTNE)
             return AliasSet::None();
         if (compareType_ == Compare_Unknown)
             return AliasSet::Store(AliasSet::Any);
         JS_ASSERT(compareType_ <= Compare_Value);
         return AliasSet::None();
     }
 
+    void printOpcode(FILE *fp);
+
   protected:
     bool congruentTo(MDefinition *const &ins) const {
         if (!MBinaryInstruction::congruentTo(ins))
             return false;
         return compareType() == ins->toCompare()->compareType() &&
                jsop() == ins->toCompare()->jsop();
     }
 };
--- a/js/src/ion/MIRGraph.cpp
+++ b/js/src/ion/MIRGraph.cpp
@@ -1058,8 +1058,33 @@ MBasicBlock::immediateDominatorBranch(Br
             return NULL;
 
         *pdirection = (test->ifTrue() == this) ? TRUE_BRANCH : FALSE_BRANCH;
         return test;
     }
 
     return NULL;
 }
+
+void
+MIRGraph::dump(FILE *fp)
+{
+#ifdef DEBUG
+    for (MBasicBlockIterator iter(begin()); iter != end(); iter++) {
+        iter->dump(fp);
+    }
+#endif
+}
+
+void
+MBasicBlock::dump(FILE *fp)
+{
+#ifdef DEBUG
+    for (MPhiIterator iter(phisBegin()); iter != phisEnd(); iter++) {
+        iter->printOpcode(fp);
+        fprintf(fp, "\n");
+    }
+    for (MInstructionIterator iter(begin()); iter != end(); iter++) {
+        iter->printOpcode(fp);
+        fprintf(fp, "\n");
+    }
+#endif
+}
--- a/js/src/ion/MIRGraph.h
+++ b/js/src/ion/MIRGraph.h
@@ -463,16 +463,18 @@ class MBasicBlock : public TempObject, p
     }
 
     bool strict() const {
         return info_.script()->strict;
     }
 
     void dumpStack(FILE *fp);
 
+    void dump(FILE *fp);
+
     // Track bailouts by storing the current pc in MIR instruction added at this
     // cycle. This is also used for tracking calls when profiling.
     void updateTrackedPc(jsbytecode *pc) {
         trackedPc_ = pc;
     }
 
     jsbytecode *trackedPc() {
         return trackedPc_;
@@ -661,16 +663,18 @@ class MIRGraph
 
     // The ParSlice is an instance of ForkJoinSlice*, it carries
     // "per-helper-thread" information.  So as not to modify the
     // calling convention for parallel code, we obtain the current
     // slice from thread-local storage.  This helper method will
     // lazilly insert an MParSlice instruction in the entry block and
     // return the definition.
     MDefinition *parSlice();
+
+    void dump(FILE *fp);
 };
 
 class MDefinitionIterator
 {
 
   friend class MBasicBlock;
 
   private:
--- a/js/src/ion/TypePolicy.cpp
+++ b/js/src/ion/TypePolicy.cpp
@@ -186,18 +186,21 @@ ComparePolicy::adjustInputs(MInstruction
 
         switch (type) {
           case MIRType_Double: {
             MToDouble::ConversionKind convert = MToDouble::NumbersOnly;
             if (compare->compareType() == MCompare::Compare_DoubleMaybeCoerceLHS && i == 0)
                 convert = MToDouble::NonNullNonStringPrimitives;
             else if (compare->compareType() == MCompare::Compare_DoubleMaybeCoerceRHS && i == 1)
                 convert = MToDouble::NonNullNonStringPrimitives;
-            if (convert == MToDouble::NumbersOnly && in->type() == MIRType_Boolean)
+            if (in->type() == MIRType_Null ||
+                (in->type() == MIRType_Boolean && convert == MToDouble::NumbersOnly))
+            {
                 in = boxAt(def, in);
+            }
             replace = MToDouble::New(in, convert);
             break;
           }
           case MIRType_Int32:
             replace = MToInt32::New(in);
             break;
           case MIRType_Object:
             replace = MUnbox::New(in, MIRType_Object, MUnbox::Infallible);
--- a/js/src/ion/ValueNumbering.cpp
+++ b/js/src/ion/ValueNumbering.cpp
@@ -362,18 +362,19 @@ ValueNumberer::eliminateRedundancies()
         if (mir->shouldCancel("Value Numbering (eliminate loop)"))
             return false;
         MBasicBlock *block = worklist.popCopy();
 
         IonSpew(IonSpew_GVN, "Looking at block %d", block->id());
 
         // Add all immediate dominators to the front of the worklist.
         if (!worklist.append(block->immediatelyDominatedBlocksBegin(),
-                             block->immediatelyDominatedBlocksEnd()))
+                             block->immediatelyDominatedBlocksEnd())) {
             return false;
+        }
 
         // For each instruction, attempt to look up a dominating definition.
         for (MDefinitionIterator iter(block); iter; ) {
             MDefinition *ins = simplify(*iter, true);
 
             // Instruction was replaced, and all uses have already been fixed.
             if (ins != *iter) {
                 iter = block->discardDefAt(iter);
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/asm.js/bug885976.js
@@ -0,0 +1,12 @@
+// |jit-test| error: TypeError
+function test(stdlib, foreign) {
+    "use asm"
+    var ff = foreign.ff
+    function f(y) {
+        y = +y;
+        ff(0);
+    }
+    return f;
+};
+f = test(this, {ff: Object.preventExtensions});
+f();
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/basic/bug864099.js
@@ -0,0 +1,13 @@
+
+a = (function() {
+    with({}) var x, arguments, arguments
+})()
+
+b = (function() {
+    with({}) {
+        var x = Math, arguments
+        ({
+            get: (1 for (x in [])),
+        })
+    }
+})()
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/basic/bug884920.js
@@ -0,0 +1,7 @@
+// |jit-test| error:SyntaxError
+
+function testcase({}, a = b, ... x)  {
+  "use strict";
+  function f() { };
+  with ( f(3) );
+}
--- a/js/src/jit-test/tests/basic/metadata-hook.js
+++ b/js/src/jit-test/tests/basic/metadata-hook.js
@@ -1,24 +1,27 @@
 
 x = [1,2,3];
 setObjectMetadata(x, {y:0});
 assertEq(getObjectMetadata(x).y, 0);
 
 incallback = false;
 count = 0;
 
-setObjectMetadataCallback(function(obj) {
+function callback(obj) {
     if (incallback)
-      return null;
+	return null;
     incallback = true;
     var res = {count:++count, location:Error().stack};
     incallback = false;
     return res;
-  });
+}
+callback({});
+
+setObjectMetadataCallback(callback);
 
 function Foo() {
   this.x = 0;
   this.y = 1;
 }
 
 function f() {
   w = new Foo();
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/ion/bug863261.js
@@ -0,0 +1,12 @@
+// |jit-test| error: InternalError: too much recursion
+function TestCase(d) {
+    toPrinted(d)
+}
+function toPrinted(value) {}
+function reportCompare (expected, actual, description) {
+    if (typeof description == "undefined")
+        toPrinted(expected);
+    new TestCase(description);
+    reportCompare();
+}
+reportCompare(Math['LN2'], Math['LN2'], 0);
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/ion/bug863755.js
@@ -0,0 +1,20 @@
+function TestCase( e, a) {
+      getTestCaseResult(e, a);
+}
+function getTestCaseResult(expected, actual) {}
+var msPerSecond =  1000;
+var TIME_0000  = (function () {  })();
+var now = new Date();
+var TIME_NOW = now.valueOf();
+function msFromTime(t) {
+    var ms = t % msPerSecond;
+    return ((ms < 0) ? msPerSecond + ms : ms );
+}
+new TestCase(false,  eval("true, false"));
+addTestCase( TIME_NOW );
+addTestCase( TIME_0000 );
+function addTestCase( t ) {
+    for ( m = 0; m <= 1000; m+=100 ) {
+        new TestCase(msFromTime(t), (new Date(t)).getMilliseconds());
+    }
+}
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/ion/bug872331.js
@@ -0,0 +1,10 @@
+
+function d(t) {
+  if (t >= undefined) {}
+}
+function s() {
+  d(null);
+}
+d(3);
+s();
+s();
--- a/js/src/jsarray.cpp
+++ b/js/src/jsarray.cpp
@@ -2798,18 +2798,22 @@ js_InitArrayClass(JSContext *cx, HandleO
     RootedObject proto(cx, global->getOrCreateObjectPrototype(cx));
     if (!proto)
         return NULL;
 
     RootedTypeObject type(cx, proto->getNewType(cx, &ArrayClass));
     if (!type)
         return NULL;
 
+    JSObject *metadata = NULL;
+    if (!NewObjectMetadata(cx, &metadata))
+        return NULL;
+
     RootedShape shape(cx, EmptyShape::getInitialShape(cx, &ArrayClass, TaggedProto(proto),
-                                                      proto->getParent(), NewObjectMetadata(cx),
+                                                      proto->getParent(), metadata,
                                                       gc::FINALIZE_OBJECT0));
 
     RootedObject arrayProto(cx, JSObject::createArray(cx, gc::FINALIZE_OBJECT4, gc::TenuredHeap, shape, type, 0));
     if (!arrayProto || !JSObject::setSingletonType(cx, arrayProto) || !AddLengthProperty(cx, arrayProto))
         return NULL;
 
     RootedFunction ctor(cx);
     ctor = global->createConstructor(cx, js_Array, cx->names().Array, 1);
@@ -2893,22 +2897,26 @@ NewArray(JSContext *cx, uint32_t length,
 
     if (!proto && !FindProto(cx, &ArrayClass, &proto))
         return NULL;
 
     RootedTypeObject type(cx, proto->getNewType(cx, &ArrayClass));
     if (!type)
         return NULL;
 
+    JSObject *metadata = NULL;
+    if (!NewObjectMetadata(cx, &metadata))
+        return NULL;
+
     /*
      * Get a shape with zero fixed slots, regardless of the size class.
      * See JSObject::createArray.
      */
     RootedShape shape(cx, EmptyShape::getInitialShape(cx, &ArrayClass, TaggedProto(proto),
-                                                      cx->global(), NewObjectMetadata(cx), gc::FINALIZE_OBJECT0));
+                                                      cx->global(), metadata, gc::FINALIZE_OBJECT0));
     if (!shape)
         return NULL;
 
     RootedObject obj(cx, JSObject::createArray(cx, allocKind, GetInitialHeap(newKind, &ArrayClass),
                                                shape, type, length));
     if (!obj)
         return NULL;
 
--- a/js/src/jsfriendapi.h
+++ b/js/src/jsfriendapi.h
@@ -1725,18 +1725,18 @@ class JS_FRIEND_API(AutoCTypesActivityCa
 
 #ifdef DEBUG
 extern JS_FRIEND_API(void)
 assertEnteredPolicy(JSContext *cx, JSObject *obj, jsid id);
 #else
 inline void assertEnteredPolicy(JSContext *cx, JSObject *obj, jsid id) {};
 #endif
 
-typedef JSObject *
-(* ObjectMetadataCallback)(JSContext *cx);
+typedef bool
+(* ObjectMetadataCallback)(JSContext *cx, JSObject **pmetadata);
 
 /*
  * Specify a callback to invoke when creating each JS object in the current
  * compartment, which may return a metadata object to associate with the
  * object. Objects with different metadata have different shape hierarchies,
  * so for efficiency, objects should generally try to share metadata objects.
  */
 JS_FRIEND_API(void)
--- a/js/src/jsinferinlines.h
+++ b/js/src/jsinferinlines.h
@@ -698,17 +698,17 @@ UseNewTypeForClone(JSFunction *fun)
 {
     if (!fun->isInterpreted())
         return false;
 
     if (fun->hasScript() && fun->nonLazyScript()->shouldCloneAtCallsite)
         return true;
 
     if (fun->isArrow())
-        return true;
+        return false;
 
     if (fun->hasSingletonType())
         return false;
 
     /*
      * When a function is being used as a wrapper for another function, it
      * improves precision greatly to distinguish between different instances of
      * the wrapper; otherwise we will conflate much of the information about
--- a/js/src/jsiter.cpp
+++ b/js/src/jsiter.cpp
@@ -373,18 +373,22 @@ Compare(T *a, T *b, size_t c)
 static inline PropertyIteratorObject *
 NewPropertyIteratorObject(JSContext *cx, unsigned flags)
 {
     if (flags & JSITER_ENUMERATE) {
         RootedTypeObject type(cx, cx->compartment()->getNewType(cx, &PropertyIteratorObject::class_, NULL));
         if (!type)
             return NULL;
 
+        JSObject *metadata = NULL;
+        if (!NewObjectMetadata(cx, &metadata))
+            return NULL;
+
         Class *clasp = &PropertyIteratorObject::class_;
-        RootedShape shape(cx, EmptyShape::getInitialShape(cx, clasp, NULL, NULL, NewObjectMetadata(cx),
+        RootedShape shape(cx, EmptyShape::getInitialShape(cx, clasp, NULL, NULL, metadata,
                                                           ITERATOR_FINALIZE_KIND));
         if (!shape)
             return NULL;
 
         JSObject *obj = JSObject::create(cx, ITERATOR_FINALIZE_KIND,
                                          GetInitialHeap(GenericObject, clasp), shape, type);
         if (!obj)
             return NULL;
--- a/js/src/jsobj.cpp
+++ b/js/src/jsobj.cpp
@@ -1245,18 +1245,22 @@ NewObject(JSContext *cx, Class *clasp, t
 {
     JS_ASSERT(clasp != &ArrayClass);
     JS_ASSERT_IF(clasp == &JSFunction::class_,
                  kind == JSFunction::FinalizeKind || kind == JSFunction::ExtendedFinalizeKind);
     JS_ASSERT_IF(parent, &parent->global() == cx->compartment()->maybeGlobal());
 
     RootedTypeObject type(cx, type_);
 
+    JSObject *metadata = NULL;
+    if (!NewObjectMetadata(cx, &metadata))
+        return NULL;
+
     RootedShape shape(cx, EmptyShape::getInitialShape(cx, clasp, TaggedProto(type->proto),
-                                                      parent, NewObjectMetadata(cx), kind));
+                                                      parent, metadata, kind));
     if (!shape)
         return NULL;
 
     gc::InitialHeap heap = GetInitialHeap(newKind, clasp);
     JSObject *obj = JSObject::create(cx, kind, heap, shape, type);
     if (!obj)
         return NULL;
 
@@ -1543,17 +1547,19 @@ js::CreateThisForFunctionWithProto(JSCon
             return NULL;
         res = CreateThisForFunctionWithType(cx, type, callee->getParent(), newKind);
     } else {
         gc::AllocKind allocKind = NewObjectGCKind(&ObjectClass);
         res = NewObjectWithClassProto(cx, &ObjectClass, proto, callee->getParent(), allocKind, newKind);
     }
 
     if (res && cx->typeInferenceEnabled()) {
-        JSScript *script = callee->as<JSFunction>().nonLazyScript();
+        JSScript *script = callee->as<JSFunction>().getOrCreateScript(cx);
+        if (!script)
+            return NULL;
         TypeScript::SetThis(cx, script, types::Type::ObjectType(res));
     }
 
     return res;
 }
 
 JSObject *
 js::CreateThisForFunction(JSContext *cx, HandleObject callee, bool newType)
--- a/js/src/jsobjinlines.h
+++ b/js/src/jsobjinlines.h
@@ -1657,28 +1657,29 @@ JSObject *
 DefineConstructorAndPrototype(JSContext *cx, HandleObject obj, JSProtoKey key, HandleAtom atom,
                               JSObject *protoProto, Class *clasp,
                               Native constructor, unsigned nargs,
                               const JSPropertySpec *ps, const JSFunctionSpec *fs,
                               const JSPropertySpec *static_ps, const JSFunctionSpec *static_fs,
                               JSObject **ctorp = NULL,
                               gc::AllocKind ctorKind = JSFunction::FinalizeKind);
 
-static JS_ALWAYS_INLINE JSObject *
-NewObjectMetadata(JSContext *cx)
+static JS_ALWAYS_INLINE bool
+NewObjectMetadata(JSContext *cx, JSObject **pmetadata)
 {
     // The metadata callback is invoked before each created object, except when
     // analysis is active as the callback may reenter JS.
+    JS_ASSERT(!*pmetadata);
     if (JS_UNLIKELY((size_t)cx->compartment()->objectMetadataCallback) &&
         !cx->compartment()->activeAnalysis)
     {
         gc::AutoSuppressGC suppress(cx);
-        return cx->compartment()->objectMetadataCallback(cx);
+        return cx->compartment()->objectMetadataCallback(cx, pmetadata);
     }
-    return NULL;
+    return true;
 }
 
 } /* namespace js */
 
 extern JSObject *
 js_InitClass(JSContext *cx, js::HandleObject obj, JSObject *parent_proto,
              js::Class *clasp, JSNative constructor, unsigned nargs,
              const JSPropertySpec *ps, const JSFunctionSpec *fs,
--- a/js/src/jsscript.cpp
+++ b/js/src/jsscript.cpp
@@ -2420,16 +2420,17 @@ js::CloneScript(JSContext *cx, HandleObj
     dst->cloneHasArray(src);
     dst->strict = src->strict;
     dst->explicitUseStrict = src->explicitUseStrict;
     dst->bindingsAccessedDynamically = src->bindingsAccessedDynamically;
     dst->funHasExtensibleScope = src->funHasExtensibleScope;
     dst->funNeedsDeclEnvObject = src->funNeedsDeclEnvObject;
     dst->funHasAnyAliasedFormal = src->funHasAnyAliasedFormal;
     dst->hasSingletons = src->hasSingletons;
+    dst->treatAsRunOnce = src->treatAsRunOnce;
     dst->isGenerator = src->isGenerator;
     dst->isGeneratorExp = src->isGeneratorExp;
 
     /* Copy over hints. */
     dst->shouldCloneAtCallsite = src->shouldCloneAtCallsite;
     dst->isCallsiteClone = src->isCallsiteClone;
 
     /*
--- a/js/src/tests/jstests.list
+++ b/js/src/tests/jstests.list
@@ -205,16 +205,32 @@ skip script test262/ch07/7.9/S7.9_A6.3_T
 skip script test262/ch07/7.9/S7.9_A6.3_T6.js
 skip script test262/ch07/7.9/S7.9_A6.3_T7.js
 skip script test262/ch07/7.9/S7.9_A6.4_T1.js
 skip script test262/ch07/7.9/S7.9_A6.4_T2.js
 skip script test262/ch07/7.9/S7.9_A7_T7.js
 skip script test262/ch07/7.9/S7.9_A9_T6.js
 skip script test262/ch07/7.9/S7.9_A9_T7.js
 skip script test262/ch07/7.9/S7.9_A9_T8.js
+skip script test262/ch08/8.2/S8.2_A2.js
+skip script test262/ch08/8.3/S8.3_A2.1.js
+skip script test262/ch08/8.3/S8.3_A2.2.js
+skip script test262/ch08/8.4/S8.4_A13_T1.js
+skip script test262/ch08/8.4/S8.4_A13_T2.js
+skip script test262/ch08/8.4/S8.4_A13_T3.js
+skip script test262/ch08/8.4/S8.4_A14_T1.js
+skip script test262/ch08/8.4/S8.4_A14_T2.js
+skip script test262/ch08/8.4/S8.4_A14_T3.js
+skip script test262/ch08/8.4/S8.4_A7.1.js
+skip script test262/ch08/8.4/S8.4_A7.2.js
+skip script test262/ch08/8.4/S8.4_A7.3.js
+skip script test262/ch08/8.4/S8.4_A7.4.js
+skip script test262/ch08/8.6/8.6.2/S8.6.2_A7.js
+skip script test262/ch08/8.7/S8.7.2_A1_T1.js
+skip script test262/ch08/8.7/S8.7.2_A1_T2.js
 skip script test262/ch11/11.1/11.1.1/S11.1.1_A1.js
 skip script test262/ch11/11.2/11.2.4/S11.2.4_A1.3_T1.js
 skip script test262/ch11/11.3/11.3.1/11.3.1-2-1gs.js
 skip script test262/ch11/11.3/11.3.1/S11.3.1_A1.1_T1.js
 skip script test262/ch11/11.3/11.3.1/S11.3.1_A1.1_T2.js
 skip script test262/ch11/11.3/11.3.1/S11.3.1_A1.1_T3.js
 skip script test262/ch11/11.3/11.3.1/S11.3.1_A1.1_T4.js
 skip script test262/ch11/11.3/11.3.1/S11.3.1_A2.1_T3.js
@@ -346,16 +362,18 @@ skip script test262/ch13/13.0/S13_A7_T3.
 # These tests are disabled because jstest doesn't understand @negative with a
 # pattern yet.
 skip script test262/ch07/7.6/7.6.1/7.6.1.2-1gs.js
 skip script test262/ch07/7.8/7.8.3/7.8.3-1gs.js
 skip script test262/ch07/7.8/7.8.3/7.8.3-2gs.js
 skip script test262/ch07/7.8/7.8.3/7.8.3-3gs.js
 skip script test262/ch07/7.8/7.8.4/7.8.4-1gs.js
 skip script test262/ch07/7.8/7.8.5/7.8.5-1gs.js
+skip script test262/ch08/8.7/8.7.2/8.7.2-3-a-1gs.js
+skip script test262/ch08/8.7/8.7.2/8.7.2-3-a-2gs.js
 skip script test262/ch10/10.1/10.1.1/10.1.1-2gs.js
 skip script test262/ch10/10.1/10.1.1/10.1.1-5gs.js
 skip script test262/ch10/10.1/10.1.1/10.1.1-8gs.js
 skip script test262/ch10/10.4/10.4.2/10.4.2.1-1gs.js
 skip script test262/ch10/10.5/10.5-1gs.js
 skip script test262/ch10/10.6/10.6-2gs.js
 skip script test262/ch11/11.1/11.1.5/11.1.5-1gs.js
 skip script test262/ch11/11.1/11.1.5/11.1.5-2gs.js
@@ -369,8 +387,10 @@ skip script test262/ch12/12.14/12.14.1/1
 skip script test262/ch13/13.0/13.0_4-5gs.js
 skip script test262/ch13/13.0/13.0_4-17gs.js
 skip script test262/ch13/13.1/13.1-1gs.js
 skip script test262/ch13/13.1/13.1-4gs.js
 skip script test262/ch13/13.1/13.1-5gs.js
 skip script test262/ch13/13.1/13.1-8gs.js
 skip script test262/ch13/13.1/13.1-13gs.js
 skip script test262/ch13/13.2/13.2-19-b-3gs.js
+skip script test262/ch14/14.1/14.1-4gs.js
+skip script test262/ch14/14.1/14.1-5gs.js
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.1/S8.1_A1_T1.js
@@ -0,0 +1,13 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * The Undefined type has one value, called undefined
+ *
+ * @path ch08/8.1/S8.1_A1_T1.js
+ * @description Checking if execution of "var x = undefined" passes
+ */
+
+// CHECK#1
+var x = undefined;
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.1/S8.1_A1_T2.js
@@ -0,0 +1,25 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * The Undefined type has one value, called undefined
+ *
+ * @path ch08/8.1/S8.1_A1_T2.js
+ * @description Check typeof(undefined) and typeof(void 0)
+ */
+
+// CHECK#1
+if (!(typeof(undefined) === "undefined")) { 
+	ERROR('#1: typeof(undefined) === "undefined". Actual: ' + (typeof(undefined)));  
+} 
+
+// CHECK#2
+if (!(typeof(void 0) === "undefined")) {  
+	ERROR('#2: typeof(void 0) === "undefined". Actual: ' + (typeof(void 0)));  
+}
+
+// CHECK#3
+if (!(undefined === void 0)) {  
+	ERROR('#3: undefined === void 0');  
+}
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.1/S8.1_A2_T1.js
@@ -0,0 +1,36 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * Any variable that has not been assigned a value has the value undefined
+ *
+ * @path ch08/8.1/S8.1_A2_T1.js
+ * @description Check that var x have value and type undefined
+ */
+
+var x;
+
+///////////////////////////////////////////////////////////////////
+// CHECK#1
+if (!(x === undefined)) {
+  $ERROR('#1: var x; x === undefined. Actual: ' + (x));
+}
+//
+///////////////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////////////
+// CHECK#2
+if (!(typeof(x) === "undefined")) {
+  $ERROR('#2: var x; typeof(x) === "undefined". Actual: ' + (typeof(x)));
+}
+//
+///////////////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////////////
+// CHECK#3
+if (!(x === void 0)) {
+  $ERROR('#3: var x; x === void 0. Actual: ' + (x));
+}
+//
+///////////////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.1/S8.1_A2_T2.js
@@ -0,0 +1,27 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * Any variable that has not been assigned a value has the value undefined
+ *
+ * @path ch08/8.1/S8.1_A2_T2.js
+ * @description Function return undefined
+ */
+
+// CHECK#1
+function test1(x) {
+	return x;
+}
+
+if (!(test1() === void 0)) {
+  $ERROR('#1: function test1(x){return x} test1() === void 0. Actual: ' + (test1()));
+}
+
+// CHECK#2
+function test2() {  
+}
+
+if (!(test2() === void 0)) {
+  $ERROR('#2: function test2(){} test2() === void 0. Actual: ' + (test2()));
+}
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.1/S8.1_A3.js
@@ -0,0 +1,16 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * undefined is not a keyword
+ *
+ * @path ch08/8.1/S8.1_A3.js
+ * @description Create variable named undefined
+ */
+
+//////////////////////////////////////////////////////////
+// CHECK1#
+var undefined = 1;
+//
+//////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.1/S8.1_A4.js
@@ -0,0 +1,16 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * If property of object not exist, return undefined
+ *
+ * @path ch08/8.1/S8.1_A4.js
+ * @description Check value of not existed property
+ */
+
+// CHECK#1 
+if ((new Object()).newProperty !== undefined) {
+  $ERROR('#1: (new Object()).newProperty === undefined. Actual: ' + ((new Object()).newProperty));
+} 
+
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.1/S8.1_A5.js
@@ -0,0 +1,23 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * Function argument that isn't provided has a value of undefined
+ *
+ * @path ch08/8.1/S8.1_A5.js
+ * @description Call function without provided argument
+ */
+
+///////////////////////////////////////
+//
+function test(arg) {
+// Check and make sure that arg is not undefined
+	if (typeof(arg) !== "undefined") {
+    $ERROR('#1: Function argument that isn\'t provided has a value of undefined. Actual: ' + (typeof(arg)));
+  }
+}
+
+test();
+//
+////////////////////////////////////////
+
new file mode 100644
new file mode 100644
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_1.js
@@ -0,0 +1,17 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_1.js
+ * @description Properties - [[HasOwnProperty]] (property does not exist)
+ */
+
+function testcase() {
+
+    var o = {};
+    return o.hasOwnProperty("foo")===false;
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_10.js
@@ -0,0 +1,18 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_10.js
+ * @description Properties - [[HasOwnProperty]] (writable, configurable, non-enumerable own value property)
+ */
+
+function testcase() {
+
+    var o = {};
+    Object.defineProperty(o, "foo", {value: 42, writable:true, configurable:true});
+    return o.hasOwnProperty("foo");
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_11.js
@@ -0,0 +1,18 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_11.js
+ * @description Properties - [[HasOwnProperty]] (writable, configurable, enumerable own value property)
+ */
+
+function testcase() {
+
+    var o = {};
+    Object.defineProperty(o, "foo", {value: 42, writable:true, enumerable:true, configurable:true});
+    return o.hasOwnProperty("foo");
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_12.js
@@ -0,0 +1,19 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_12.js
+ * @description Properties - [[HasOwnProperty]] (non-writable, non-configurable, non-enumerable inherited value property)
+ */
+
+function testcase() {
+
+    var base = {};
+    Object.defineProperty(base, "foo", {value: 42});
+    var o = Object.create(base);
+    return o.hasOwnProperty("foo")===false;
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_13.js
@@ -0,0 +1,19 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_13.js
+ * @description Properties - [[HasOwnProperty]] (non-writable, non-configurable, enumerable inherited value property)
+ */
+
+function testcase() {
+
+    var base = {};
+    Object.defineProperty(base, "foo", {value: 42, enumerable:true});
+    var o = Object.create(base);
+    return o.hasOwnProperty("foo")===false;
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_14.js
@@ -0,0 +1,19 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_14.js
+ * @description Properties - [[HasOwnProperty]] (non-writable, configurable, non-enumerable inherited value property)
+ */
+
+function testcase() {
+
+    var base = {};
+    Object.defineProperty(base, "foo", {value: 42, configurable:true});
+    var o = Object.create(base);
+    return o.hasOwnProperty("foo")===false;
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_15.js
@@ -0,0 +1,19 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_15.js
+ * @description Properties - [[HasOwnProperty]] (writable, non-configurable, non-enumerable inherited value property)
+ */
+
+function testcase() {
+
+    var base = {};
+    Object.defineProperty(base, "foo", {value: 42, writable:true});
+    var o = Object.create(base);
+    return o.hasOwnProperty("foo")===false;
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_16.js
@@ -0,0 +1,19 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_16.js
+ * @description Properties - [[HasOwnProperty]] (non-writable, configurable, enumerable inherited value property)
+ */
+
+function testcase() {
+
+    var base = {};
+    Object.defineProperty(base, "foo", {value: 42, configurable:true, enumerable:true});
+    var o = Object.create(base);
+    return o.hasOwnProperty("foo")===false;
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_17.js
@@ -0,0 +1,19 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_17.js
+ * @description Properties - [[HasOwnProperty]] (writable, non-configurable, enumerable inherited value property)
+ */
+
+function testcase() {
+
+    var base = {};
+    Object.defineProperty(base, "foo", {value: 42, writable:true, enumerable:true});
+    var o = Object.create(base);
+    return o.hasOwnProperty("foo")===false;
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_18.js
@@ -0,0 +1,19 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_18.js
+ * @description Properties - [[HasOwnProperty]] (writable, configurable, non-enumerable inherited value property)
+ */
+
+function testcase() {
+
+    var base = {};
+    Object.defineProperty(base, "foo", {value: 42, writable:true, configurable:true});
+    var o = Object.create(base);
+    return o.hasOwnProperty("foo")===false;
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_19.js
@@ -0,0 +1,19 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_19.js
+ * @description Properties - [[HasOwnProperty]] (writable, configurable, enumerable inherited value property)
+ */
+
+function testcase() {
+
+    var base = {};
+    Object.defineProperty(base, "foo", {value: 42, writable:true, enumerable:true, configurable:true});
+    var o = Object.create(base);
+    return o.hasOwnProperty("foo")===false;
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_2.js
@@ -0,0 +1,17 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_2.js
+ * @description Properties - [[HasOwnProperty]] (old style own property)
+ */
+
+function testcase() {
+
+    var o = {foo: 42};
+    return o.hasOwnProperty("foo");
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_20.js
@@ -0,0 +1,17 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_20.js
+ * @description Properties - [[HasOwnProperty]] (literal own getter property)
+ */
+
+function testcase() {
+
+    var o = { get foo() { return 42;} };
+    return o.hasOwnProperty("foo");
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_21.js
@@ -0,0 +1,17 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_21.js
+ * @description Properties - [[HasOwnProperty]] (literal own setter property)
+ */
+
+function testcase() {
+
+    var o = { set foo(x) {;} };
+    return o.hasOwnProperty("foo");
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_22.js
@@ -0,0 +1,17 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_22.js
+ * @description Properties - [[HasOwnProperty]] (literal own getter/setter property)
+ */
+
+function testcase() {
+
+    var o = { get foo() { return 42;}, set foo(x) {;} };
+    return o.hasOwnProperty("foo");
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_23.js
@@ -0,0 +1,18 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_23.js
+ * @description Properties - [[HasOwnProperty]] (literal inherited getter property)
+ */
+
+function testcase() {
+
+    var base = { get foo() { return 42;} };
+    var o = Object.create(base);
+    return o.hasOwnProperty("foo")===false;
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_24.js
@@ -0,0 +1,18 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_24.js
+ * @description Properties - [[HasOwnProperty]] (literal inherited setter property)
+ */
+
+function testcase() {
+
+    var base = { set foo(x) {;} };
+    var o = Object.create(base);
+    return o.hasOwnProperty("foo")===false;
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_25.js
@@ -0,0 +1,18 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_25.js
+ * @description Properties - [[HasOwnProperty]] (literal inherited getter/setter property)
+ */
+
+function testcase() {
+
+    var base = { get foo() { return 42;}, set foo(x) {;} };
+    var o = Object.create(base);
+    return o.hasOwnProperty("foo")===false;
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_26.js
@@ -0,0 +1,18 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_26.js
+ * @description Properties - [[HasOwnProperty]] (non-configurable, non-enumerable own getter property)
+ */
+
+function testcase() {
+
+    var o = {};
+    Object.defineProperty(o, "foo", {get: function() {return 42;}});
+    return o.hasOwnProperty("foo");
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_27.js
@@ -0,0 +1,18 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_27.js
+ * @description Properties - [[HasOwnProperty]] (non-configurable, enumerable own getter property)
+ */
+
+function testcase() {
+
+    var o = {};
+    Object.defineProperty(o, "foo", {get: function() {return 42;}, enumerable:true});
+    return o.hasOwnProperty("foo");
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_28.js
@@ -0,0 +1,18 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_28.js
+ * @description Properties - [[HasOwnProperty]] (configurable, non-enumerable own getter property)
+ */
+
+function testcase() {
+
+    var o = {};
+    Object.defineProperty(o, "foo", {get: function() {return 42;}, configurable:true});
+    return o.hasOwnProperty("foo");
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_29.js
@@ -0,0 +1,18 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_29.js
+ * @description Properties - [[HasOwnProperty]] (configurable, enumerable own getter property)
+ */
+
+function testcase() {
+
+    var o = {};
+    Object.defineProperty(o, "foo", {get: function() {return 42;}, enumerable:true, configurable:true});
+    return o.hasOwnProperty("foo");
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_3.js
@@ -0,0 +1,18 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_3.js
+ * @description Properties - [[HasOwnProperty]] (old style inherited property)
+ */
+
+function testcase() {
+
+    var base = {foo:42};
+    var o = Object.create(base);
+    return o.hasOwnProperty("foo")===false;
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_30.js
@@ -0,0 +1,18 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_30.js
+ * @description Properties - [[HasOwnProperty]] (non-configurable, non-enumerable own setter property)
+ */
+
+function testcase() {
+
+    var o = {};
+    Object.defineProperty(o, "foo", {set: function() {;}});
+    return o.hasOwnProperty("foo");
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_31.js
@@ -0,0 +1,18 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_31.js
+ * @description Properties - [[HasOwnProperty]] (non-configurable, enumerable own setter property)
+ */
+
+function testcase() {
+
+    var o = {};
+    Object.defineProperty(o, "foo", {set: function() {;}, enumerable:true});
+    return o.hasOwnProperty("foo");
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_32.js
@@ -0,0 +1,18 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_32.js
+ * @description Properties - [[HasOwnProperty]] (configurable, non-enumerable own setter property)
+ */
+
+function testcase() {
+
+    var o = {};
+    Object.defineProperty(o, "foo", {set: function() {;}, configurable:true});
+    return o.hasOwnProperty("foo");
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_33.js
@@ -0,0 +1,18 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_33.js
+ * @description Properties - [[HasOwnProperty]] (configurable, enumerable own setter property)
+ */
+
+function testcase() {
+
+    var o = {};
+    Object.defineProperty(o, "foo", {set: function() {;}, enumerable:true, configurable:true});
+    return o.hasOwnProperty("foo");
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_34.js
@@ -0,0 +1,18 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_34.js
+ * @description Properties - [[HasOwnProperty]] (non-configurable, non-enumerable own getter/setter property)
+ */
+
+function testcase() {
+
+    var o = {};
+    Object.defineProperty(o, "foo", {get: function() {return 42;}, set: function() {;}});
+    return o.hasOwnProperty("foo");
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_35.js
@@ -0,0 +1,18 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_35.js
+ * @description Properties - [[HasOwnProperty]] (non-configurable, enumerable own getter/setter property)
+ */
+
+function testcase() {
+
+    var o = {};
+    Object.defineProperty(o, "foo", {get: function() {return 42;}, set: function() {;}, enumerable:true});
+    return o.hasOwnProperty("foo");
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_36.js
@@ -0,0 +1,18 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_36.js
+ * @description Properties - [[HasOwnProperty]] (configurable, non-enumerable own getter/setter property)
+ */
+
+function testcase() {
+
+    var o = {};
+    Object.defineProperty(o, "foo", {get: function() {return 42;}, set: function() {;}, configurable:true});
+    return o.hasOwnProperty("foo");
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_37.js
@@ -0,0 +1,18 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_37.js
+ * @description Properties - [[HasOwnProperty]] (configurable, enumerable own getter/setter property)
+ */
+
+function testcase() {
+
+    var o = {};
+    Object.defineProperty(o, "foo", {get: function() {return 42;}, set: function() {;}, enumerable:true, configurable:true});
+    return o.hasOwnProperty("foo");
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_38.js
@@ -0,0 +1,19 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_38.js
+ * @description Properties - [[HasOwnProperty]] (non-configurable, non-enumerable inherited getter property)
+ */
+
+function testcase() {
+
+    var base = {};
+    Object.defineProperty(base, "foo", {get: function() {return 42;}});
+    var o = Object.create(base);
+    return o.hasOwnProperty("foo")===false;
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_39.js
@@ -0,0 +1,19 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_39.js
+ * @description Properties - [[HasOwnProperty]] (non-configurable, enumerable inherited getter property)
+ */
+
+function testcase() {
+
+    var base = {};
+    Object.defineProperty(base, "foo", {get: function() {return 42;}, enumerable:true});
+    var o = Object.create(base);
+    return o.hasOwnProperty("foo")===false;
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_4.js
@@ -0,0 +1,18 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_4.js
+ * @description Properties - [[HasOwnProperty]] (non-writable, non-configurable, non-enumerable own value property)
+ */
+
+function testcase() {
+
+    var o = {};
+    Object.defineProperty(o, "foo", {value: 42});
+    return o.hasOwnProperty("foo");
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_40.js
@@ -0,0 +1,19 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_40.js
+ * @description Properties - [[HasOwnProperty]] (configurable, non-enumerable inherited getter property)
+ */
+
+function testcase() {
+
+    var base = {};
+    Object.defineProperty(base, "foo", {get: function() {return 42;}, configurable:true});
+    var o = Object.create(base);
+    return o.hasOwnProperty("foo")===false;
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_41.js
@@ -0,0 +1,19 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_41.js
+ * @description Properties - [[HasOwnProperty]] (configurable, enumerable inherited getter property)
+ */
+
+function testcase() {
+
+    var base = {};
+    Object.defineProperty(base, "foo", {get: function() {return 42;}, enumerable:true, configurable:true});
+    var o = Object.create(base);
+    return o.hasOwnProperty("foo")===false;
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_42.js
@@ -0,0 +1,19 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_42.js
+ * @description Properties - [[HasOwnProperty]] (non-configurable, non-enumerable inherited setter property)
+ */
+
+function testcase() {
+
+    var base = {};
+    Object.defineProperty(base, "foo", {set: function() {;}});
+    var o = Object.create(base);
+    return o.hasOwnProperty("foo")===false;
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_43.js
@@ -0,0 +1,19 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_43.js
+ * @description Properties - [[HasOwnProperty]] (non-configurable, enumerable inherited setter property)
+ */
+
+function testcase() {
+
+    var base = {};
+    Object.defineProperty(base, "foo", {set: function() {;}, enumerable:true});
+    var o = Object.create(base);
+    return o.hasOwnProperty("foo")===false;
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_44.js
@@ -0,0 +1,19 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_44.js
+ * @description Properties - [[HasOwnProperty]] (configurable, non-enumerable inherited setter property)
+ */
+
+function testcase() {
+
+    var base = {};
+    Object.defineProperty(base, "foo", {set: function() {;}, configurable:true});
+    var o = Object.create(base);
+    return o.hasOwnProperty("foo")===false;
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_45.js
@@ -0,0 +1,19 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_45.js
+ * @description Properties - [[HasOwnProperty]] (configurable, enumerable inherited setter property)
+ */
+
+function testcase() {
+
+    var base = {};
+    Object.defineProperty(base, "foo", {set: function() {;}, enumerable:true, configurable:true});
+    var o = Object.create(base);
+    return o.hasOwnProperty("foo")===false;
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_46.js
@@ -0,0 +1,19 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_46.js
+ * @description Properties - [[HasOwnProperty]] (non-configurable, non-enumerable inherited getter/setter property)
+ */
+
+function testcase() {
+
+    var base = {};
+    Object.defineProperty(base, "foo", {get: function() {return 42;}, set: function() {;}});
+    var o = Object.create(base);
+    return o.hasOwnProperty("foo")===false;
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_47.js
@@ -0,0 +1,19 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_47.js
+ * @description Properties - [[HasOwnProperty]] (non-configurable, enumerable inherited getter/setter property)
+ */
+
+function testcase() {
+
+    var base = {};
+    Object.defineProperty(base, "foo", {get: function() {return 42;}, set: function() {;}, enumerable:true});
+    var o = Object.create(base);
+    return o.hasOwnProperty("foo")===false;
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_48.js
@@ -0,0 +1,19 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_48.js
+ * @description Properties - [[HasOwnProperty]] (configurable, non-enumerable inherited getter/setter property)
+ */
+
+function testcase() {
+
+    var base = {};
+    Object.defineProperty(base, "foo", {get: function() {return 42;}, set: function() {;}, configurable:true});
+    var o = Object.create(base);
+    return o.hasOwnProperty("foo")===false;
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_49.js
@@ -0,0 +1,19 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_49.js
+ * @description Properties - [[HasOwnProperty]] (configurable, enumerable inherited getter/setter property)
+ */
+
+function testcase() {
+
+    var base = {};
+    Object.defineProperty(base, "foo", {get: function() {return 42;}, set: function() {;}, enumerable:true, configurable:true});
+    var o = Object.create(base);
+    return o.hasOwnProperty("foo")===false;
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_5.js
@@ -0,0 +1,18 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_5.js
+ * @description Properties - [[HasOwnProperty]] (non-writable, non-configurable, enumerable own value property)
+ */
+
+function testcase() {
+
+    var o = {};
+    Object.defineProperty(o, "foo", {value: 42, enumerable:true});
+    return o.hasOwnProperty("foo");
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_6.js
@@ -0,0 +1,18 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_6.js
+ * @description Properties - [[HasOwnProperty]] (non-writable, configurable, non-enumerable own value property)
+ */
+
+function testcase() {
+
+    var o = {};
+    Object.defineProperty(o, "foo", {value: 42, configurable:true});
+    return o.hasOwnProperty("foo");
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_7.js
@@ -0,0 +1,18 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_7.js
+ * @description Properties - [[HasOwnProperty]] (writable, non-configurable, non-enumerable own value property)
+ */
+
+function testcase() {
+
+    var o = {};
+    Object.defineProperty(o, "foo", {value: 42, writable:true});
+    return o.hasOwnProperty("foo");
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_8.js
@@ -0,0 +1,18 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_8.js
+ * @description Properties - [[HasOwnProperty]] (non-writable, configurable, enumerable own value property)
+ */
+
+function testcase() {
+
+    var o = {};
+    Object.defineProperty(o, "foo", {value: 42, configurable:true, enumerable:true});
+    return o.hasOwnProperty("foo");
+
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.1/8.12.1-1_9.js
@@ -0,0 +1,18 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.1/8.12.1-1_9.js
+ * @description Properties - [[HasOwnProperty]] (writable, non-configurable, enumerable own value property)
+ */
+
+function testcase() {
+
+    var o = {};
+    Object.defineProperty(o, "foo", {value: 42, writable:true, enumerable:true});
+    return o.hasOwnProperty("foo");
+
+}
+runTestCase(testcase);
new file mode 100644
new file mode 100644
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.3/S8.12.3_A1.js
@@ -0,0 +1,32 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * [[Get]](P) method should return value when property P does not exist in instance but prototype contain it
+ *
+ * @path ch08/8.12/8.12.3/S8.12.3_A1.js
+ * @description Try to get P when property P does not exist in instance but prototype contain it
+ */
+
+//Establish foo object 
+function FooObj(){}; FooObj.prototype.propFoo="some";
+
+// Invoke instance of foo object
+var __obj= new FooObj;
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+if (__obj.propFoo !== "some"){
+  $ERROR('#1: function FooObj(){}; FooObj.prototype.propFoo="some"; var __obj= new FooObj; __obj.propFoo === "some". Actual: ' + (__obj.propFoo));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#2
+if (__obj['propFoo'] !== "some"){
+  $ERROR('#1: function FooObj(){}; FooObj.prototype.propFoo="some"; var __obj= new FooObj; __obj[\'propFoo\'] === "some". Actual: ' + (__obj['propFoo']));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.3/S8.12.3_A2.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.
+
+/**
+ * [[Get]](P) method should return undefined when property P does not exist both in instance and prototype
+ *
+ * @path ch08/8.12/8.12.3/S8.12.3_A2.js
+ * @description Try to get P when property P does not exist both in instance and prototype
+ */
+
+var __obj={};
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+if (__obj.propFoo !== undefined){
+  $ERROR('#1: var __obj={}; __obj.propFoo === undefined. Actual: ' + (__obj.propFoo));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#2
+if (__obj['propFoo'] !== undefined){
+  $ERROR('#2: var __obj={}; __obj[\'propFoo\'] === undefined. Actual: ' + (__obj['propFoo']));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.3/S8.12.3_A3.js
@@ -0,0 +1,60 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * When the [[Get]] method of O is called with property name P value of P returns
+ *
+ * @path ch08/8.12/8.12.3/S8.12.3_A3.js
+ * @description Try to get P property P exist in instance
+ */
+
+var __map={shape:"cube", 5:"five", "6":"six"};
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+if (__map.shape !== "cube"){
+  $ERROR('#1: var __map={shape:"cube", 5:"five", "6":"six"}; __map.shape === "cube". Actual: ' + (__map.shape));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#2
+if (__map["shape"] !== "cube"){
+  $ERROR('#2: var __map={shape:"cube", 5:"five", "6":"six"}; __map["shape"] === "cube". Actual: ' + (__map["shape"]));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#3
+if (__map["5"] !== "five"){
+  $ERROR('#3: var __map={shape:"cube", 5:"five", "6":"six"}; __map["5"] === "five". Actual: ' + (__map["5"]));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#4
+if (__map[5] !== "five"){
+  $ERROR('#4: var __map={shape:"cube", 5:"five", "6":"six"}; __map[5] === "five". Actual: ' + (__map[5]));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#5
+if (__map["6"] !== "six"){
+  $ERROR('#5: var __map={shape:"cube", 5:"five", "6":"six"}; __map["6"] === "six". Actual: ' + (__map["6"]));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#6
+if (__map[6] !== "six"){
+  $ERROR('#6: var __map={shape:"cube", 5:"five", "6":"six"}; __map[6] === "six". Actual: ' + (__map[6]));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
new file mode 100644
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.4/8.14.4-8-b_1.js
@@ -0,0 +1,19 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.4/8.14.4-8-b_1.js
+ * @description Non-writable property on a prototype written to.
+ */
+
+function testcase() {   
+    function foo() {};
+    Object.defineProperty(foo.prototype, "bar", {value: "unwritable"}); 
+    
+    var o = new foo(); 
+    o.bar = "overridden"; 
+    return o.hasOwnProperty("bar")===false && o.bar==="unwritable";
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.4/8.14.4-8-b_2.js
@@ -0,0 +1,26 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.4/8.14.4-8-b_2.js
+ * @description Non-writable property on a prototype written to in strict mode.
+ * @onlyStrict
+ */
+
+function testcase() {
+    "use strict";
+    
+    function foo() {};
+    Object.defineProperty(foo.prototype, "bar", {value: "unwritable"}); 
+    
+    var o = new foo(); 
+    try {
+        o.bar = "overridden"; 
+        return false;
+    } catch(e) {
+        return (e instanceof TypeError) && (o.bar==="unwritable");
+    }
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.4/S8.12.4_A1.js
@@ -0,0 +1,17 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * If the property has the ReadOnly attribute, [[CanPut]](P) return false
+ *
+ * @path ch08/8.12/8.12.4/S8.12.4_A1.js
+ * @description Try put other value for Math.E property
+ * @noStrict
+ */
+
+var __e = Math.E;
+Math.E = 1;
+if (Math.E !== __e){
+  $ERROR('#1: __e = Math.E; Math.E = 1; Math.E === __e. Actual: ' + (Math.E));
+}
+
new file mode 100644
new file mode 100644
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.5/8.12.5-3-b_1.js
@@ -0,0 +1,40 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.5/8.12.5-3-b_1.js
+ * @description Changing the value of a data property should not affect it's non-value property descriptor attributes.
+ */
+
+
+function testcase() {
+    var origReduce = Array.prototype.reduce;
+    var origDesc = Object.getOwnPropertyDescriptor(Array.prototype, "reduce");
+    var newDesc;
+    
+    try {
+        Array.prototype.reduce = function () {;};
+        newDesc = Object.getOwnPropertyDescriptor(Array.prototype, "reduce");
+        var descArray = [origDesc, newDesc];
+        
+        for (var j in descArray) {  //Ensure no attributes are magically added to newDesc
+            for (var i in descArray[j]) {
+                if (i==="value") {
+                    if (origDesc[i]===newDesc[i]) {
+                        return false;
+                    }
+                }
+                else if (origDesc[i]!==newDesc[i]) {
+                    return false;
+                }
+            }
+        }
+        return true;        
+    
+    } finally {
+        Array.prototype.reduce = origReduce;
+    }
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.5/8.12.5-3-b_2.js
@@ -0,0 +1,44 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.5/8.12.5-3-b_2.js
+ * @description Changing the value of a data property should not affect it's non-value property descriptor attributes.
+ */
+
+
+function testcase() {
+    var tempObj = {};
+    
+    Object.defineProperty(tempObj, "reduce", { value:456, enumerable:false, writable:true});
+    var origReduce = tempObj.reduce;
+    var origDesc = Object.getOwnPropertyDescriptor(tempObj, "reduce");
+
+    var newDesc;
+    
+    try {
+        tempObj.reduce = 123;
+        newDesc = Object.getOwnPropertyDescriptor(tempObj, "reduce");
+        var descArray = [origDesc, newDesc];
+        
+        for (var j in descArray) {
+            for (var i in descArray[j]) {
+                if (i==="value") {
+                    if (origDesc[i]===newDesc[i]) {
+                        return false;
+                    }
+                }
+                else if (origDesc[i]!==newDesc[i]) {
+                    return false;
+                }
+            }
+        }
+        return true;
+    
+    } finally {
+        tempObj.reduce = origReduce;
+    }
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.5/8.12.5-5-b_1.js
@@ -0,0 +1,39 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.5/8.12.5-5-b_1.js
+ * @description Changing the value of an accessor property should not affect it's property descriptor attributes.
+ */
+
+
+function testcase() {
+    var tempObj = {};
+    
+    Object.defineProperty(tempObj, "reduce", { get: function() {return 456;}, enumerable:false, set: function() {;}});
+    var origReduce = tempObj.reduce;
+    var origDesc = Object.getOwnPropertyDescriptor(tempObj, "reduce");
+
+    var newDesc;
+    
+    try {
+        tempObj.reduce = 123;
+        newDesc = Object.getOwnPropertyDescriptor(tempObj, "reduce");
+        var descArray = [origDesc, newDesc];
+        
+        for (var j in descArray) {
+            for (var i in descArray[j]) {
+                if (origDesc[i]!==newDesc[i]) {
+                    return false;
+                }
+            }
+        }
+        return tempObj.reduce===456;        
+    
+    } finally {
+        tempObj.reduce = origReduce;
+    }
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.5/S8.12.5_A1.js
@@ -0,0 +1,38 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * When the [[Put]] method of O is called with property P and value V,
+ * and If O doesn't have a property with name P, then
+ * creates a property with name P, set its value to V and give it empty attributes
+ *
+ * @path ch08/8.12/8.12.5/S8.12.5_A1.js
+ * @description Put to not existent properties
+ */
+
+var __map={}; __map[1]="one"; __map["two"]=2; __map["3"]="tre";
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+if (__map[1] !== "one") {
+	$ERROR('#1: var __map={}; __map[1]="one"; __map["two"]=2; __map["3"]="tre"; __map[1] === "one". Actual: ' + (__map[1]));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#2
+if (__map["two"] !== 2) {
+	$ERROR('#2: var __map={}; __map[1]="one"; __map["two"]=2; __map["3"]="tre"; __map["two"] === 2. Actual: ' + (__map["two"]));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#3
+if (__map["3"] !== "tre") {
+	$ERROR('#3: var __map={}; __map[1]="one"; __map["two"]=2; __map["3"]="tre"; __map["3"] === "tre". Actual: ' + (__map["3"]));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.5/S8.12.5_A2.js
@@ -0,0 +1,49 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * When the [[Put]] method of O is called with property P and value V,
+ * then set the value of the property to V. The attributes of the property are not changed
+ *
+ * @path ch08/8.12/8.12.5/S8.12.5_A2.js
+ * @description Put to existent properties
+ */
+
+var _map={1:"one",two:2};
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+_map[1]="uno";
+if (_map[1] !== "uno") {
+  $ERROR('#1: var _map={1:"one",two:2}; _map[1]="uno"; _map[1] === "uno". Actual: ' + (_map[1]));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#2
+_map["1"]=1;
+if (_map[1] !== 1) {
+  $ERROR('#2: var _map={1:"one",two:2}; _map[1]="uno"; _map["1"]=1; _map[1] === 1. Actual: ' + (_map[1]));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#3
+_map["two"]="two";
+if (_map["two"] !== "two") {
+  $ERROR('#3: var _map={1:"one",two:2}; _map[1]="uno"; _map["1"]=1; _map["two"]="two"; _map["two"] === "two". Actual: ' + (_map["two"]));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#4
+_map.two="duo";
+if (_map.two !== "duo") {
+  $ERROR('#4: var _map={1:"one",two:2}; _map[1]="uno"; _map["1"]=1; _map["two"]="two"; _map.two="duo"; _map.two === "duo". Actual: ' + (_map.two));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
new file mode 100644
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.6/S8.12.6_A1.js
@@ -0,0 +1,20 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * When the [[HasProperty]] method of O is called with property name P and if O has a property with name P, return true
+ *
+ * @path ch08/8.12/8.12.6/S8.12.6_A1.js
+ * @description Try find existent property of any Object
+ */
+
+var __obj={fooProp:"fooooooo"};
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+if (!("fooProp" in __obj)) {
+  $ERROR('#1: var __obj={fooProp:"fooooooo"}; "fooProp" in __obj');
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.6/S8.12.6_A2_T1.js
@@ -0,0 +1,21 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * When the [[HasProperty]] method of O is called with property name P and if O has not a property with name P
+ * then If the [[Prototype]] of O is null, return false or call the [[HasProperty]] method of [[Prototype]] with property name P
+ *
+ * @path ch08/8.12/8.12.6/S8.12.6_A2_T1.js
+ * @description Try find not existent property of any Object
+ */
+
+var __obj={};
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+if (!("valueOf" in __obj)) {
+  $ERROR('#1: var __obj={}; "valueOf" in __obj');
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.6/S8.12.6_A2_T2.js
@@ -0,0 +1,43 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * When the [[HasProperty]] method of O is called with property name P and if O has not a property with name P
+ * then If the [[Prototype]] of O is null, return false or call the [[HasProperty]] method of [[Prototype]] with property name P
+ *
+ * @path ch08/8.12/8.12.6/S8.12.6_A2_T2.js
+ * @description Try find not existent property of any Object, but existent property of this Object prototype
+ */
+
+var __proto={phylum:"avis"};
+
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+if (!("valueOf" in __proto)) {
+  $ERROR('#1: var __proto={phylum:"avis"}; "valueOf" in __proto');
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+function Robin(){this.name="robin"};
+Robin.prototype=__proto;
+
+var __my__robin = new Robin;
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#2
+if (!("phylum" in __my__robin)) {
+  $ERROR('#2: var __proto={phylum:"avis"}; function Robin(){this.name="robin"}; Robin.prototype=__proto; var __my__robin = new Robin; "phylum" in __my__robin');
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#3
+if (__my__robin.hasOwnProperty("phylum")) {
+  $ERROR('#3: var __proto={phylum:"avis"}; function Robin(){this.name="robin"}; Robin.prototype=__proto; var __my__robin = new Robin; __my__robin.hasOwnProperty("phylum") === false. Actual: ' + (__my__robin.hasOwnProperty("phylum")));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.6/S8.12.6_A3.js
@@ -0,0 +1,44 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * [[hasProperty]] is sensitive to property existence but [[Get]] is not
+ *
+ * @path ch08/8.12/8.12.6/S8.12.6_A3.js
+ * @description Use [[hasProperty]] and [[Get]] for existent and not existent properties
+ */
+
+var __obj={}; __obj.hole=undefined;
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+if (__obj.hole !== undefined) {
+  $ERROR('#1: var __obj={}; __obj.hole=undefined; __obj.hole === undefined. Actual: ' + (__obj.hole));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#2
+if (__obj.notexist !== undefined) {
+  $ERROR('#2: var __obj={}; __obj.hole=undefined; __obj.notexist === undefined. Actual: ' + (__obj.notexist));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#3
+if (!("hole" in __obj)) {
+  $ERROR('#3: var __obj={}; __obj.hole=undefined; "hole" in __obj');
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#4
+if (("notexist" in __obj)) {
+  $ERROR('#4: var __obj={}; __obj.hole=undefined; "notexist" in __obj');
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
new file mode 100644
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.7/S8.12.7_A1.js
@@ -0,0 +1,29 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * When the [[Delete]] method of O is called with property name P,
+ * and If the property has the DontDelete attribute, return false
+ *
+ * @path ch08/8.12/8.12.7/S8.12.7_A1.js
+ * @description Try to delete Math.E, that has the DontDelete attribute
+ * @noStrict
+ */
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+if (delete Math.E !== false){
+  $ERROR('#1: delete Math.E === false. Actual: ' + (delete Math.E));
+};
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#2
+if (Math.E === undefined){
+  $ERROR('#2: delete Math.E; Math.E !== undefined');
+};
+//
+//////////////////////////////////////////////////////////////////////////////
+
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.7/S8.12.7_A2_T1.js
@@ -0,0 +1,39 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * When the [[Delete]] method of O is called with property name P,
+ * and if O doesn't have a property with name P, return true
+ *
+ * @path ch08/8.12/8.12.7/S8.12.7_A2_T1.js
+ * @description Try to delete not existent properties
+ */
+
+var __color__map = {};
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+if (delete __color__map.red !== true){
+  $ERROR('#1: var __color__map = {}; delete __color__map.red === true. Actual: ' + (delete __color__map.red));
+};
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#2
+if (delete __color__map["green"] !== true){
+  $ERROR('#2: var __color__map = {}; delete __color__map["green"] === true. Actual: ' + (delete __color__map["green"]));
+};
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#3
+var blue = 1;
+if (delete __color__map[blue] !== true){
+  $ERROR('#3: var __color__map = {}; var blue = 1; delete __color__map[blue] === true. Actual: ' + (delete __color__map[blue]));
+};
+//
+//////////////////////////////////////////////////////////////////////////////
+
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.7/S8.12.7_A2_T2.js
@@ -0,0 +1,40 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * When the [[Delete]] method of O is called with property name P,
+ * and if O doesn't have a property with name P, return true
+ *
+ * @path ch08/8.12/8.12.7/S8.12.7_A2_T2.js
+ * @description Try to delete not existent properties of O, but existent property of prototype
+ */
+
+function Palette(){};
+Palette.prototype = {red:0xFF0000, green:0x00FF00};
+var __palette = new Palette;
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+if (__palette.red !== 0xFF0000){
+  $ERROR('#1: function Palette(){}; Palette.prototype = {red:0xFF0000, green:0x00FF00}; __palette = new Palette; __palette.red === 0xFF0000. Actual: ' + (__palette.red));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#2
+if (delete __palette.red !== true) {
+  $ERROR('#2 function Palette(){}; Palette.prototype = {red:0xFF0000, green:0x00FF00}; __palette = new Palette; delete __palette.red === true. Actual: ' + (delete __palette.red));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#3
+if (__palette.red !== 0xFF0000){
+  $ERROR('#3: function Palette(){}; Palette.prototype = {red:0xFF0000, green:0x00FF00}; __palette = new Palette; __palette.red === 0xFF0000. Actual: ' + (__palette.red));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.7/S8.12.7_A3.js
@@ -0,0 +1,49 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * When the [[Delete]] method of O is called with property name P,
+ * removes the property with name P from O and return true
+ *
+ * @path ch08/8.12/8.12.7/S8.12.7_A3.js
+ * @description Delete existent properties
+ */
+
+var BLUE_NUM=1;
+var BLUE_STR="1";
+var YELLOW_NUM=2;
+var YELLOW_STR="2";
+var __color__map = {red:0xFF0000, BLUE_NUM:0x0000FF, green:0x00FF00, YELLOW_STR:0xFFFF00};
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+if (delete __color__map[YELLOW_NUM] !== true){
+  $ERROR('#1: var BLUE_NUM=1; var BLUE_STR="1"; var YELLOW_NUM=2; var YELLOW_STR="2"; var __color__map = {red:0xFF0000, BLUE_NUM:0x0000FF, green:0x00FF00, YELLOW_STR:0xFFFF00}; delete __color__map[YELLOW_NUM] === true;');
+};
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#2
+if (__color__map[YELLOW_STR] !== undefined) {
+  $ERROR('#2: var BLUE_NUM=1; var BLUE_STR="1"; var YELLOW_NUM=2; var YELLOW_STR="2"; var __color__map = {red:0xFF0000, BLUE_NUM:0x0000FF, green:0x00FF00, YELLOW_STR:0xFFFF00}; delete __color__map[YELLOW_NUM]; __color__map[YELLOW_STR] === undefined. Actual: ' + (__color__map[YELLOW_STR]));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#3
+if (delete __color__map[BLUE_STR] !== true){
+  $ERROR('#3: var BLUE_NUM=1; var BLUE_STR="1"; var YELLOW_NUM=2; var YELLOW_STR="2"; var __color__map = {red:0xFF0000, BLUE_NUM:0x0000FF, green:0x00FF00, YELLOW_STR:0xFFFF00}; delete __color__map[BLUE_STR] === true. Actual: ' + (delete __color__map[BLUE_STR]));
+};
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#4
+if (__color__map[BLUE_NUM] !== undefined) {
+  $ERROR('#4: var BLUE_NUM=1; var BLUE_STR="1"; var YELLOW_NUM=2; var YELLOW_STR="2"; var __color__map = {red:0xFF0000, BLUE_NUM:0x0000FF, green:0x00FF00, YELLOW_STR:0xFFFF00}; delete __color__map[BLUE_STR]; __color__map[BLUE_NUM] === undefined. Actual: ' + (__color__map[BLUE_NUM]));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
new file mode 100644
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.8/S8.12.8_A1.js
@@ -0,0 +1,26 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * This should generate a TypeError,
+ * Cause we overload toString method so it return non Primitive value
+ * See ECMA reference at http://bugzilla.mozilla.org/show_bug.cgi?id=167325
+ *
+ * @path ch08/8.12/8.12.8/S8.12.8_A1.js
+ * @description Try to overload toString method
+ */
+
+try
+{
+	var __obj = {toString: function() {return new Object();}}  
+	String(__obj);
+	$ERROR('#1.1: var __obj = {toString: function() {return new Object();}}; String(__obj) throw TypeError. Actual: ' + (String(__obj)));
+}
+catch(e)
+{
+	if ((e instanceof TypeError) !== true) {
+	  $ERROR('#1.2: var __obj = {toString: function() {return new Object();}}; String(__obj) throw TypeError. Actual: ' + (e));
+	}  
+}  
+
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.8/S8.12.8_A2.js
@@ -0,0 +1,26 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * This should generate no TypeError,
+ * Cause we overload toString method so it return non Primitive value
+ * but we overloaded valueOf method too.
+ * See ECMA reference at http://bugzilla.mozilla.org/show_bug.cgi?id=167325
+ *
+ * @path ch08/8.12/8.12.8/S8.12.8_A2.js
+ * @description Try to overload toString, that returned new Object, and valueOf methods
+ */
+
+try
+{
+	var __obj = {toString: function() {return new Object();}, valueOf: function() {return 1;}}
+	if (String(__obj) !== "1") {
+	  $ERROR('#1.1: var __obj = {toString: function() {return new Object();}, valueOf: function() {return 1;}}; String(__obj) === "1". Actual: ' + (String(__obj)));
+	}
+}
+catch(e)
+{
+  $ERROR('#1.2: var __obj = {toString: function() {return new Object();}, valueOf: function() {return 1;}}; String(__obj) === "1". Actual: ' + (e));
+}  
+
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.8/S8.12.8_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.
+
+/**
+ * We overload valueOf method so it return non Primitive value
+ * Thus [[DefaultValue]] must return Object.toString() value
+ *
+ * @path ch08/8.12/8.12.8/S8.12.8_A3.js
+ * @description Try to overload toString method, that returned Primitive, and valueOf method, that returned new Object
+ */
+
+try
+{
+  var __obj = {toString: function() {return "1"}, valueOf: function() {return new Object();}}
+  if (Number(__obj) !== 1) {
+    $ERROR('#1.1: var __obj = {toNumber: function() {return "1"}, valueOf: function() {return new Object();}}; Number(__obj) === 1. Actual: ' + (Number(__obj)));
+  }
+}
+catch(e)
+{
+  $ERROR('#1.2: var __obj = {toNumber: function() {return "1"}, valueOf: function() {return new Object();}}; Number(__obj) === 1. Actual: ' + (e));
+}  
+
+
+
+  
+
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.8/S8.12.8_A4.js
@@ -0,0 +1,24 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * We overload valueOf method so it return non Primitive value and toString method so it return non Primitive value too
+ * Thus [[DefaultValue]] must generate TypeError error
+ *
+ * @path ch08/8.12/8.12.8/S8.12.8_A4.js
+ * @description Try to overload toString and valueOf methods, they returned new Objects
+ */
+
+try
+{
+  var __obj = {valueOf:function(){return new Object;},toString: function() {return new Object();}}  
+  Number(__obj);
+  $ERROR('#1.1: var __obj = {valueOf:function(){return new Object;},toNumber: function() {return new Object();}}; Number(__obj) throw TypeError. Actual: ' + (Number(__obj)));
+}
+catch(e)
+{
+  if ((e instanceof TypeError) !== true) {
+    $ERROR('#1.2: var __obj = {valueOf:function(){return new Object;},toNumber: function() {return new Object();}}; Number(__obj) throw TypeError. Actual: ' + (e));
+  }  
+}  
+
new file mode 100644
new file mode 100644
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.9/8.12.9-9-b-i_1.js
@@ -0,0 +1,23 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.9/8.12.9-9-b-i_1.js
+ * @description Redefine a configurable data property to be an accessor property on a newly non-extensible object
+ */
+
+
+function testcase() {
+    var o = {};
+    Object.defineProperty(o, "foo", 
+                          { value: "hello", 
+                            configurable: true});
+    Object.preventExtensions(o);
+    Object.defineProperty(o, "foo", { get: function() { return 5;} });
+
+    var fooDescrip = Object.getOwnPropertyDescriptor(o, "foo");
+    return o.foo===5 && fooDescrip.get!==undefined && fooDescrip.set===undefined && fooDescrip.value===undefined && fooDescrip.configurable===true && fooDescrip.enumerable===false && fooDescrip.writable===undefined;
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.9/8.12.9-9-b-i_2.js
@@ -0,0 +1,25 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.9/8.12.9-9-b-i_2.js
+ * @description Redefine a configurable data property to be an accessor property on a newly non-extensible object
+ */
+
+
+function testcase() {
+    var o = {};
+    Object.defineProperty(o, "foo", 
+                          { value: "hello", 
+                            configurable: true,
+                            enumerable: true,
+                            writable: true});
+    Object.preventExtensions(o);
+    Object.defineProperty(o, "foo", { get: function() { return 5;} });
+
+    var fooDescrip = Object.getOwnPropertyDescriptor(o, "foo");
+    return o.foo===5 && fooDescrip.get!==undefined && fooDescrip.set===undefined && fooDescrip.value===undefined && fooDescrip.configurable===true && fooDescrip.enumerable===true && fooDescrip.writable===undefined;
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.9/8.12.9-9-c-i_1.js
@@ -0,0 +1,23 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.9/8.12.9-9-c-i_1.js
+ * @description Redefine a configurable accessor property to be a data property on a non-extensible object
+ */
+
+
+function testcase() {
+    var o = {};
+    Object.defineProperty(o, "foo", 
+                          { get: function() { return 5;}, 
+                            configurable: true});
+    Object.preventExtensions(o);
+    Object.defineProperty(o, "foo", { value: "hello"});
+
+    var fooDescrip = Object.getOwnPropertyDescriptor(o, "foo");
+    return o.foo==="hello" && fooDescrip.get===undefined && fooDescrip.set===undefined && fooDescrip.value==="hello" && fooDescrip.configurable===true && fooDescrip.enumerable===false && fooDescrip.writable===false;
+}
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.9/8.12.9-9-c-i_2.js
@@ -0,0 +1,25 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.12/8.12.9/8.12.9-9-c-i_2.js
+ * @description Redefine a configurable accessor property to be a data property on a non-extensible object
+ */
+
+
+function testcase() {
+    var o = {};
+    Object.defineProperty(o, "foo", 
+                          { get: function() { return 5;}, 
+                            configurable: true});
+    Object.preventExtensions(o);
+    Object.defineProperty(o, "foo", 
+                          { value: "hello",
+                            writable: true});
+
+    var fooDescrip = Object.getOwnPropertyDescriptor(o, "foo");
+    return o.foo==="hello" && fooDescrip.get===undefined && fooDescrip.set===undefined && fooDescrip.value==="hello" && fooDescrip.configurable===true && fooDescrip.enumerable===false && fooDescrip.writable===true;
+}
+runTestCase(testcase);
new file mode 100644
new file mode 100644
new file mode 100644
new file mode 100644
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.2/S8.2_A1_T1.js
@@ -0,0 +1,17 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * The Null Type has one value, called null
+ *
+ * @path ch08/8.2/S8.2_A1_T1.js
+ * @description Checking if execution of "var x = null" passes
+ */
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+var x = null;
+//
+//////////////////////////////////////////////////////////////////////////////
+
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.2/S8.2_A1_T2.js
@@ -0,0 +1,17 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * The Null Type has one value, called null
+ *
+ * @path ch08/8.2/S8.2_A1_T2.js
+ * @description Checking if execution of "x = null" passes
+ */
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+var x = null;
+//
+//////////////////////////////////////////////////////////////////////////////
+
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.2/S8.2_A2.js
@@ -0,0 +1,15 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * The null is resrved word
+ *
+ * @path ch08/8.2/S8.2_A2.js
+ * @description Checking if execution of "var null" fails
+ * @negative
+ */
+
+var null;
+
+
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.2/S8.2_A3.js
@@ -0,0 +1,23 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * For the keyword null the typeof operator returns the "object"
+ * See also
+ * http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Operators:Special_Operators:typeof_Operator
+ * and
+ * http://bugs.ecmascript.org/ticket/250
+ * for example
+ *
+ * @path ch08/8.2/S8.2_A3.js
+ * @description Check type of null
+ */
+
+//////////////////////////////////////////////////////////////
+// CHECK#1
+if (typeof(null) !== "object") {
+  $ERROR('#1: typeof null === "object". Actual: ' + (typeof null));
+}
+//
+/////////////////////////////////////////////////////////////
+
new file mode 100644
new file mode 100644
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.3/S8.3_A1_T1.js
@@ -0,0 +1,30 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * The Boolean type have two values, called true and false
+ *
+ * @path ch08/8.3/S8.3_A1_T1.js
+ * @description Assign true and false to variables
+ */
+
+if (x !== undefined) {
+    $ERROR("#0 x !== undefined, but actual is "+ x);
+}   
+
+////////////////////////////////////////////////////////////////////////
+// CHECK#1
+var x = true;
+var y = false;
+
+if (x !== true) {
+    $ERROR("#1.1 x !== true, but actual is "+ x);
+} 
+
+if (y !== false) {
+    $ERROR("#1.1 y !== false, but actual is "+ y);
+} 
+
+//
+////////////////////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.3/S8.3_A1_T2.js
@@ -0,0 +1,75 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * The Boolean type have two values, called true and false
+ *
+ * @path ch08/8.3/S8.3_A1_T2.js
+ * @description Check type of true/false and it`s equality
+ */
+
+//////////////////////////////////////////////////////////////////////
+// CHECK#1
+if (typeof(true) !== "boolean") {
+  $ERROR('#1: typeof(true) === "boolean"');
+}
+//
+//////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////
+// CHECK#2
+if (typeof(true) != "boolean") {
+  $ERROR('#2: typeof(true) == "boolean"');
+}
+//
+//////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////
+// CHECK#3
+if (typeof(false) !== "boolean") {
+  $ERROR('#3: typeof(false) === "boolean"');
+}
+//
+//////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////
+// CHECK#4
+if (typeof(false) != "boolean") {
+  $ERROR('#4: typeof(false) == "boolean"');
+}
+//
+//////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////
+// CHECK#5
+if (true === false) {
+  $ERROR('#5: true !== false');
+}
+//
+//////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////
+// CHECK#6
+if (true == false) {
+  $ERROR('#6: true != false');
+}
+//
+//////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////
+// CHECK#7
+if (false === true) {
+  $ERROR('#7: false !== true');
+}
+//
+//////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////
+// CHECK#8
+if (false == true) {
+  $ERROR('#8: false != true');
+}
+//
+//////////////////////////////////////////////////////////////////////
+
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.3/S8.3_A2.1.js
@@ -0,0 +1,13 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * The true is reserved word
+ *
+ * @path ch08/8.3/S8.3_A2.1.js
+ * @description Checking if execution of "true=1" fails
+ * @negative
+ */
+
+true = 1;
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.3/S8.3_A2.2.js
@@ -0,0 +1,13 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * The false is reserved word
+ *
+ * @path ch08/8.3/S8.3_A2.2.js
+ * @description Checking if execution of "false=0" fails
+ * @negative
+ */
+
+false = 0;
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.3/S8.3_A3.js
@@ -0,0 +1,42 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * Applaing negation to boolean works well
+ *
+ * @path ch08/8.3/S8.3_A3.js
+ * @description Check not false equals true, not true equals false
+ */
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+if (!false !== true){
+  $ERROR('#1: !false === true');
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#2
+if (!false != true){
+  $ERROR('#2: !false == true');
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#3
+if (!true !== false){
+  $ERROR('#3: !true === false');
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#4
+if (!true != false){
+  $ERROR('#4: !true == false');
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
new file mode 100644
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.4/S8.4_A1.js
@@ -0,0 +1,46 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * Any variable that has been assigned with string literal has the type string
+ *
+ * @path ch08/8.4/S8.4_A1.js
+ * @description Check type of variable that has been assigned with string literal
+ */
+
+/////////////////////////////////////////////////////////
+// CHECK#1
+var str="abcdfg";
+if (typeof(str)!=="string"){
+  $ERROR('#1: var str="abcdfg"; typeof(str) === "string". Actual: ' + (typeof(str)));
+}
+//
+////////////////////////////////////////////////////////
+
+/////////////////////////////////////////////////////////
+// CHECK#2
+var str2='qwerty';
+if (typeof(str2)!=="string"){
+  $ERROR('#2: var str2=\'qwerty\'; typeof(str) === "string". Actual: ' + (typeof(str2)));
+}
+//
+////////////////////////////////////////////////////////
+
+/////////////////////////////////////////////////////////
+// CHECK#3
+var __str='\u0042\u0043\u0044\u0045\u0046\u0047\u0048';
+if (typeof(__str)!=="string"){
+  $ERROR('#3: var __str=\'\\u0042\\u0043\\u0044\\u0045\\u0046\\u0047\\u0048\'; typeof(__str) === "string". Actual: ' + (typeof(__str)));
+}
+//
+////////////////////////////////////////////////////////
+
+/////////////////////////////////////////////////////////
+// CHECK#4
+var str__="\u0042\u0043\u0044\u0045\u0046\u0047\u0048";
+if (typeof(str__)!=="string"){
+  $ERROR('#4: var str__="abcdfg"; typeof(str__) === "string". Actual: ' + (typeof(str__)));
+}
+//
+////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.4/S8.4_A10.js
@@ -0,0 +1,37 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * Both unicode and ascii chars are allowed
+ *
+ * @path ch08/8.4/S8.4_A10.js
+ * @description Create string using both unicode and ascii chars
+ */
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+var __str = "\u0041A\u0042B\u0043C";
+if (__str !== 'AABBCC'){
+  $ERROR('#1: var __str = "\\u0041A\\u0042B\\u0043C"; __str === \'AABBCC\'. Actual: ' + (__str));
+};
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#2
+var __str__ = "\u0041\u0042\u0043"+'ABC';
+if (__str__ !== 'ABCABC'){
+  $ERROR('#2: var __str__ = "\\u0041\\u0042\\u0043"+\'ABC\'; __str__ === \'ABCABC\'. Actual: ' + (__str__));
+};
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#3
+var str__ = "ABC"+'\u0041\u0042\u0043';
+if (str__ !== "ABCABC"){
+  $ERROR('#2: var str__ = "ABC"+\'\\u0041\\u0042\\u0043\'; str__ === "ABCABC". Actual: ' + (str__));
+};
+//
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.4/S8.4_A11.js
@@ -0,0 +1,16 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * Presence of reserved words in string literal are allowed
+ *
+ * @path ch08/8.4/S8.4_A11.js
+ * @description Create string variable, thet include all reserved words
+ */
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+var __delete=" break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof ";
+//
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.4/S8.4_A12.js
@@ -0,0 +1,19 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * Assignment to string literal calls String constructor
+ *
+ * @path ch08/8.4/S8.4_A12.js
+ * @description Check constructor of simple assigned variable
+ */
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+var str = "rock'n'roll";
+if (str.constructor !== String){
+  $ERROR('#1: var str = "rock\'n\'roll"; str.constructor === String. Actual: ' + (str.constructor));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.4/S8.4_A13_T1.js
@@ -0,0 +1,13 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * When appears not closed single-quote program failes
+ *
+ * @path ch08/8.4/S8.4_A13_T1.js
+ * @description Try to create variable using 3 single-quote
+ * @negative
+ */
+
+var str = ''';
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.4/S8.4_A13_T2.js
@@ -0,0 +1,13 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * When appears not closed single-quote program failes
+ *
+ * @path ch08/8.4/S8.4_A13_T2.js
+ * @description Try to create variable using 1 single-quote
+ * @negative
+ */
+
+var str = ';
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.4/S8.4_A13_T3.js
@@ -0,0 +1,13 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * When appears not closed single-quote program failes
+ *
+ * @path ch08/8.4/S8.4_A13_T3.js
+ * @description Try to create variable using 4 single-quote
+ * @negative
+ */
+
+var str = '''';
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.4/S8.4_A14_T1.js
@@ -0,0 +1,13 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * When appears not closed double-quote program failes
+ *
+ * @path ch08/8.4/S8.4_A14_T1.js
+ * @description Try to create variable using 1 double-quote
+ * @negative
+ */
+
+var str = ";
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.4/S8.4_A14_T2.js
@@ -0,0 +1,13 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * When appears not closed double-quote program failes
+ *
+ * @path ch08/8.4/S8.4_A14_T2.js
+ * @description Try to create variable using 3 double-quote
+ * @negative
+ */
+
+var str = """;
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.4/S8.4_A14_T3.js
@@ -0,0 +1,13 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * When appears not closed double-quote program failes
+ *
+ * @path ch08/8.4/S8.4_A14_T3.js
+ * @description Try to create variable using 4 double-quote
+ * @negative
+ */
+
+var str = """";
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.4/S8.4_A2.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.
+
+/**
+ * Empty string has type string
+ *
+ * @path ch08/8.4/S8.4_A2.js
+ * @description Create empty string and check it type
+ */
+
+/////////////////////////////////////////////////////////
+// CHECK#1
+var str = '';
+if (typeof(str) !== 'string'){
+  $ERROR('#1: var str = \'\'; typeof(str) === \'string\'. Actual: ' + (typeof(str)));
+}
+//
+////////////////////////////////////////////////////////
+
+/////////////////////////////////////////////////////////
+// CHECK#2
+var str = "";
+if (typeof(str) !== "string"){
+  $ERROR('#2: var str = ""; typeof(str) === "string". Actual: ' + (str));
+}
+//
+////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.4/S8.4_A3.js
@@ -0,0 +1,19 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * String type has a length property
+ *
+ * @path ch08/8.4/S8.4_A3.js
+ * @description Try read length property of string variable
+ */
+
+var __str = "ABCDEFGH";
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+if (__str.length !== 8) {
+  $ERROR('#1: var __str = "ABCDEFGH"; __str.length === 8. Actual: ' + (__str.length));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.4/S8.4_A4.js
@@ -0,0 +1,19 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * Empty string variable has a length property
+ *
+ * @path ch08/8.4/S8.4_A4.js
+ * @description Try read length property of empty string variable
+ */
+
+var __str = "";
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+if (__str.length !== 0) {
+  $ERROR('#1: var __str = ""; __str.length === 0. Actual: ' + (__str));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.4/S8.4_A5.js
@@ -0,0 +1,20 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * Zero "\0" not terminates the string(C string)
+ *
+ * @path ch08/8.4/S8.4_A5.js
+ * @description Insert "\0" into string
+ */
+
+// CHECK#1
+if ("x\0y" === "x") {
+  $ERROR('#1: "x\\0y" !== "x"');
+}
+
+// CHECK#2
+if (!(("x\0a" < "x\0b") && ("x\0b" < "x\0c"))) {
+  $ERROR('#2: (("x\\0a" < "x\\0b") && ("x\\0b" < "x\\0c")) === true');
+}
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.4/S8.4_A6.1.js
@@ -0,0 +1,19 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * Large string 4096 bytes
+ *
+ * @path ch08/8.4/S8.4_A6.1.js
+ * @description Assign variable by large string
+ */
+
+////////////////////////////////////////////////////
+// Check#1
+var largeStr='Standard ECMA-2623r d Edition - December 1999S t a n d a r d i z i n g Informat i o n and Commu n i c a t i o n SystemsPhone: +41 22 849.60.00 - Fax: +41 22 849.60.01 - URL: ht tp: / /www.ecma.ch - Internet: helpdesk@ecma.chECMAScript LanguageSpecificationStandard ECMA-2623r d Edition - December 1999S t a n d a r d i z i n g Informat i o n and Commu n i c a t i o n SystemsPhone: +41 22 849.60.00 - Fax: +41 22 849.60.01 - URL: ht tp: / /www.ecma.ch - Internet: helpdesk@ecma.chMB Ecma-262.doc 08-04-02 16,53ECMAScript LanguageSpecificationBrief HistoryThis ECMA Standard is based on several originating technologies, the most well known being JavaScript (Netscape)and JScript (Microsoft). The language was invented by Brendan Eich at Netscape and first appeared in thatcompan Navigator 2.0 browser. It has appeared in all subsequent browsers from Netscape and in all browsers fromMicrosoft starting with Internet Explorer 3.0.The development of this Standard started in November 1996. The first edition of this ECMA Standard was adopted bythe ECMA General Assembly of June 1997.That ECMA Standard was submitted to ISO/IEC JTC 1 for adoption under the fast-track procedure, and approved asinternational standard ISO/IEC 16262, in April 1998. The ECMA General Assembly of June 1998 approved thesecond edition of ECMA-262 to keep it fully aligned with ISO/IEC 16262. Changes between the first and the secondedition are editorial in nature.The current document defines the third edition of the Standard and includes powerful regular expressions, betterstring handling, new control statements, try/catch exception handling, tighter definition of errors, formatting fornumeric output and minor changes in anticipation of forthcoming internationalisation facilities and future languagegrowth.Work on the language is not complete. The technical committee is working on significant enhancements, includingmechanisms for scripts to be created and used across the Internet, and tighter coordination with other standards bodiessuch as groups within the World Wide Web Consortium and the Wireless Application Protocol Forum.This Standard has been adopted as 3rd Edition of ECMA-262 by the ECMA General Assembly in December, 1999.- i -Table of contents1 Scope 12 Conformance 13 References 14 Overview 1 4.1 Web Scripting 2 4.2 Language Overview 2 4.2.1 Objects 3 4.3 Definitions 4 4.3.1 Type 4 4.3.2 Primitive Value 4 4.3.3 Object 4 4.3.4 Constructor 4 4.3.5 Prototype 4 4.3.6 Native Object 4 4.3.7 Built-in Object 4 4.3.8 Host Object 4 4.3.9 Undefined Value 4 4.3.10 Undefined Type 4 4.3.11 Null Value 4 4.3.12 Null Type 4 4.3.13 Boolean Value 4 4.3.14 Boolean Type 4 4.3.15 Boolean Object 5 4.3.16 String Value 5 4.3.17 String Type 5 4.3.18 String Object 5 4.3.19 Number Value 5 4.3.20 Number Type 5 4.3.21 Number Object 5 4.3.22 Infinity 5 4.3.23 NaN 5 5 Notational Conventions 6 5.1 Syntactic and Lexical Grammars 6 5.1.1 Context-Free Grammars 6 5.1.2 The Lexical and RegExp Grammars 6 5.1.3 The Numeric String Grammar 6 5.1.4 The Syntactic Grammar 6 5.1.5 Grammar Notation 7 5.2 Algorithm Conventions 9 6. Source Text 10 7 Lexical Conventions 11 7.1 Unicode Format-Control Characters 11 7.2 White Space 11 7.3 Line Terminators 12 7.4 Comments 12 - ii - 7.5 Tokens 13 7.5.1 Reserved Words 13 7.5.2 Keywords 13 7.5.3 Future Reserved Words 14 7.6 Identifiers 14 7.7 Punctuators 15 7.8 Literals 16 7.8.1 Null Literals 16 7.8.2 Boolean Literals 16 7.8.3 Numeric Literals 16 7.8.4 String Literals 18 7.8.5 Regular Expression Literals 20 7.9 Automatic Semicolon Insertion 21 7.9.1 Rules of Automatic Semicolon Insertion 21 7.9.2 Examples of Automatic Semicolon Insertion 22 8 Types 24 8.1 The Undefined Type 24 8.2 The Null Type 24 8.3 The Boolean Type 24 8.4 The String Type 24 8.5 The Number Type 24 8.6 The Object Type 25 8.6.1 Property Attributes 25 8.6.2 Internal Properties and Methods 26 8.7 The Reference Type 29 8.7.1 GetValue (V) 29 8.7.2 PutValue (V, W) 29 8.8 The List Type 30 8.9 The Completion Type 30 9 Type Conversion 30 9.1 ToPrimitive 30 9.2 ToBoolean 30 9.3 ToNumber 31 9.3.1 ToNumber Ap';
+if(largeStr !== 'Standard ECMA-2623r d Edition - December 1999S t a n d a r d i z i n g Informat i o n and Commu n i c a t i o n SystemsPhone: +41 22 849.60.00 - Fax: +41 22 849.60.01 - URL: ht tp: / /www.ecma.ch - Internet: helpdesk@ecma.chECMAScript LanguageSpecificationStandard ECMA-2623r d Edition - December 1999S t a n d a r d i z i n g Informat i o n and Commu n i c a t i o n SystemsPhone: +41 22 849.60.00 - Fax: +41 22 849.60.01 - URL: ht tp: / /www.ecma.ch - Internet: helpdesk@ecma.chMB Ecma-262.doc 08-04-02 16,53ECMAScript LanguageSpecificationBrief HistoryThis ECMA Standard is based on several originating technologies, the most well known being JavaScript (Netscape)and JScript (Microsoft). The language was invented by Brendan Eich at Netscape and first appeared in thatcompan Navigator 2.0 browser. It has appeared in all subsequent browsers from Netscape and in all browsers fromMicrosoft starting with Internet Explorer 3.0.The development of this Standard started in November 1996. The first edition of this ECMA Standard was adopted bythe ECMA General Assembly of June 1997.That ECMA Standard was submitted to ISO/IEC JTC 1 for adoption under the fast-track procedure, and approved asinternational standard ISO/IEC 16262, in April 1998. The ECMA General Assembly of June 1998 approved thesecond edition of ECMA-262 to keep it fully aligned with ISO/IEC 16262. Changes between the first and the secondedition are editorial in nature.The current document defines the third edition of the Standard and includes powerful regular expressions, betterstring handling, new control statements, try/catch exception handling, tighter definition of errors, formatting fornumeric output and minor changes in anticipation of forthcoming internationalisation facilities and future languagegrowth.Work on the language is not complete. The technical committee is working on significant enhancements, includingmechanisms for scripts to be created and used across the Internet, and tighter coordination with other standards bodiessuch as groups within the World Wide Web Consortium and the Wireless Application Protocol Forum.This Standard has been adopted as 3rd Edition of ECMA-262 by the ECMA General Assembly in December, 1999.- i -Table of contents1 Scope 12 Conformance 13 References 14 Overview 1 4.1 Web Scripting 2 4.2 Language Overview 2 4.2.1 Objects 3 4.3 Definitions 4 4.3.1 Type 4 4.3.2 Primitive Value 4 4.3.3 Object 4 4.3.4 Constructor 4 4.3.5 Prototype 4 4.3.6 Native Object 4 4.3.7 Built-in Object 4 4.3.8 Host Object 4 4.3.9 Undefined Value 4 4.3.10 Undefined Type 4 4.3.11 Null Value 4 4.3.12 Null Type 4 4.3.13 Boolean Value 4 4.3.14 Boolean Type 4 4.3.15 Boolean Object 5 4.3.16 String Value 5 4.3.17 String Type 5 4.3.18 String Object 5 4.3.19 Number Value 5 4.3.20 Number Type 5 4.3.21 Number Object 5 4.3.22 Infinity 5 4.3.23 NaN 5 5 Notational Conventions 6 5.1 Syntactic and Lexical Grammars 6 5.1.1 Context-Free Grammars 6 5.1.2 The Lexical and RegExp Grammars 6 5.1.3 The Numeric String Grammar 6 5.1.4 The Syntactic Grammar 6 5.1.5 Grammar Notation 7 5.2 Algorithm Conventions 9 6. Source Text 10 7 Lexical Conventions 11 7.1 Unicode Format-Control Characters 11 7.2 White Space 11 7.3 Line Terminators 12 7.4 Comments 12 - ii - 7.5 Tokens 13 7.5.1 Reserved Words 13 7.5.2 Keywords 13 7.5.3 Future Reserved Words 14 7.6 Identifiers 14 7.7 Punctuators 15 7.8 Literals 16 7.8.1 Null Literals 16 7.8.2 Boolean Literals 16 7.8.3 Numeric Literals 16 7.8.4 String Literals 18 7.8.5 Regular Expression Literals 20 7.9 Automatic Semicolon Insertion 21 7.9.1 Rules of Automatic Semicolon Insertion 21 7.9.2 Examples of Automatic Semicolon Insertion 22 8 Types 24 8.1 The Undefined Type 24 8.2 The Null Type 24 8.3 The Boolean Type 24 8.4 The String Type 24 8.5 The Number Type 24 8.6 The Object Type 25 8.6.1 Property Attributes 25 8.6.2 Internal Properties and Methods 26 8.7 The Reference Type 29 8.7.1 GetValue (V) 29 8.7.2 PutValue (V, W) 29 8.8 The List Type 30 8.9 The Completion Type 30 9 Type Conversion 30 9.1 ToPrimitive 30 9.2 ToBoolean 30 9.3 ToNumber 31 9.3.1 ToNumber Ap'){
+  $ERROR('#1: Large string 4096 bytes');
+}
+//
+////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.4/S8.4_A6.2.js
@@ -0,0 +1,19 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * Large string 8192 bytes
+ *
+ * @path ch08/8.4/S8.4_A6.2.js
+ * @description Assign variable by large string
+ */
+
+////////////////////////////////////////////////////
+// Check#2
+var largeStr='Standard ECMA-2623r d Edition - December 1999S t a n d a r d i z i n g Informat i o n and Commu n i c a t i o n SystemsPhone: +41 22 849.60.00 - Fax: +41 22 849.60.01 - URL: ht tp: / /www.ecma.ch - Internet: helpdesk@ecma.chECMAScript LanguageSpecificationStandard ECMA-2623r d Edition - December 1999S t a n d a r d i z i n g Informat i o n and Commu n i c a t i o n SystemsPhone: +41 22 849.60.00 - Fax: +41 22 849.60.01 - URL: ht tp: / /www.ecma.ch - Internet: helpdesk@ecma.chMB Ecma-262.doc 08-04-02 16,53ECMAScript LanguageSpecificationBrief HistoryThis ECMA Standard is based on several originating technologies, the most well known being JavaScript (Netscape)and JScript (Microsoft). The language was invented by Brendan Eich at Netscape and first appeared in thatcompans Navigator 2.0 browser. It has appeared in all subsequent browsers from Netscape and in all browsers fromMicrosoft starting with Internet Explorer 3.0.The development of this Standard started in November 1996. The first edition of this ECMA Standard was adopted bythe ECMA General Assembly of June 1997.That ECMA Standard was submitted to ISO/IEC JTC 1 for adoption under the fast-track procedure, and approved asinternational standard ISO/IEC 16262, in April 1998. The ECMA General Assembly of June 1998 approved thesecond edition of ECMA-262 to keep it fully aligned with ISO/IEC 16262. Changes between the first and the secondedition are editorial in nature.The current document defines the third edition of the Standard and includes powerful regular expressions, betterstring handling, new control statements, try/catch exception handling, tighter definition of errors, formatting fornumeric output and minor changes in anticipation of forthcoming internationalisation facilities and future languagegrowth.Work on the language is not complete. The technical committee is working on significant enhancements, includingmechanisms for scripts to be created and used across the Internet, and tighter coordination with other standards bodiessuch as groups within the World Wide Web Consortium and the Wireless Application Protocol Forum.This Standard has been adopted as 3rd Edition of ECMA-262 by the ECMA General Assembly in December, 1999.- i -Table of contents1 Scope 12 Conformance 13 References 14 Overview 1 4.1 Web Scripting 2 4.2 Language Overview 2 4.2.1 Objects 3 4.3 Definitions 4 4.3.1 Type 4 4.3.2 Primitive Value 4 4.3.3 Object 4 4.3.4 Constructor 4 4.3.5 Prototype 4 4.3.6 Native Object 4 4.3.7 Built-in Object 4 4.3.8 Host Object 4 4.3.9 Undefined Value 4 4.3.10 Undefined Type 4 4.3.11 Null Value 4 4.3.12 Null Type 4 4.3.13 Boolean Value 4 4.3.14 Boolean Type 4 4.3.15 Boolean Object 5 4.3.16 String Value 5 4.3.17 String Type 5 4.3.18 String Object 5 4.3.19 Number Value 5 4.3.20 Number Type 5 4.3.21 Number Object 5 4.3.22 Infinity 5 4.3.23 NaN 5 5 Notational Conventions 6 5.1 Syntactic and Lexical Grammars 6 5.1.1 Context-Free Grammars 6 5.1.2 The Lexical and RegExp Grammars 6 5.1.3 The Numeric String Grammar 6 5.1.4 The Syntactic Grammar 6 5.1.5 Grammar Notation 7 5.2 Algorithm Conventions 9 6. Source Text 10 7 Lexical Conventions 11 7.1 Unicode Format-Control Characters 11 7.2 White Space 11 7.3 Line Terminators 12 7.4 Comments 12 - ii - 7.5 Tokens 13 7.5.1 Reserved Words 13 7.5.2 Keywords 13 7.5.3 Future Reserved Words 14 7.6 Identifiers 14 7.7 Punctuators 15 7.8 Literals 16 7.8.1 Null Literals 16 7.8.2 Boolean Literals 16 7.8.3 Numeric Literals 16 7.8.4 String Literals 18 7.8.5 Regular Expression Literals 20 7.9 Automatic Semicolon Insertion 21 7.9.1 Rules of Automatic Semicolon Insertion 21 7.9.2 Examples of Automatic Semicolon Insertion 22 8 Types 24 8.1 The Undefined Type 24 8.2 The Null Type 24 8.3 The Boolean Type 24 8.4 The String Type 24 8.5 The Number Type 24 8.6 The Object Type 25 8.6.1 Property Attributes 25 8.6.2 Internal Properties and Methods 26 8.7 The Reference Type 29 8.7.1 GetValue (V) 29 8.7.2 PutValue (V, W) 29 8.8 The List Type 30 8.9 The Completion Type 30 9 Type Conversion 30 9.1 ToPrimitive 30 9.2 ToBoolean 30 9.3 ToNumber 31 9.3.1 ToNumber Applied to the String Type 31 9.4 ToInteger 34 9.5 ToInt32: (Signed 32 Bit Integer) 34 9.6 ToUint32: (Unsigned 32 Bit Integer) 34 9.7 ToUint16: (Unsigned 16 Bit Integer) 35 9.8 ToString 35 9.8.1 ToString Applied to the Number Type 35 9.9 ToObject 36 10 Execution Contexts 37 10.1 Definitions 37 10.1.1 Function Objects 37 10.1.2 Types of Executable Code 37 10.1.3 Variable Instantiation 37 10.1.4 Scope Chain and Identifier Resolution 38 10.1.5 Global Object 38 10.1.6 Activation Object 38 - i i i - 10.1.7 This 39 10.1.8 Arguments Object 39 10.2 Entering An Execution Context 39 10.2.1 Global Code 39 10.2.2 Eval Code 39 10.2.3 Function Code 39 11 Expressions 40 11.1 Primary Expressions 40 11.1.1 The this Keyword 40 11.1.2 Identifier Reference 40 11.1.3 Literal Reference 40 11.1.4 Array Initialiser 40 11.1.5 Object Initialiser 41 11.1.6 The Grouping Operator 42 11.2 Left-Hand-Side Expressions 43 11.2.1 Property Accessors 43 11.2.2 The new Operator 44 11.2.3 Function Calls 44 11.2.4 Argument Lists 45 11.2.5 Function Expressions 45 11.3 Postfix Expressions 45 11.3.1 Postfix Increment Operator 45 11.3.2 Postfix Decrement Operator 45 11.4 Unary Operators 46 11.4.1 The delete Operator 46 11.4.2 The void Operator 46 11.4.3 The typeof Operator 46 11.4.4 Prefix Increment Operator 47 11.4.5 Prefix Decrement Operator 47 11.4.6 Unary + Operator 47 11.4.7 Unary - Operator 47 11.4.8 Bitwise NOT Operator ( ~) 48 11.4.9 Logical NOT Operator ( !) 48 11.5 Multiplicative Operators 48 11.5.1 Applying the * Operator 48 11.5.2 Applying the / Operator 49 11.5.3 Applying the % Operator 49 11.6 Additive Operators 50 11.6.1 The Addition operator ( +) 50 11.6.2 The Subtraction Operator ( -) 50 11.6.3 Applying the Additive Operators ( +,- ) to Numbers 51 11.7 Bitwise Shift Operators 51 11.7.1 The Left Shift Operator ( <<) 51 11.7.2 The Signed Right Shift Operator ( >>) 51 11.7.3 The Unsigned Right Shift Operator ( >>>) 52 11.4 Relational Operators 52 11.8.1 The Less-than Operator ( <) 53 11.8.2 The Greater-than Operator ( >) 53 11.8.3 The Less-than-or-equal Operator ( <=) 53 11.8.4 The Greater-than-or-equal Operator ( >=) 53 11.8.5 The Abstract Relational Comparison Algorithm 53 - iv - 11.8.6 The instanceof operator 54 11.8.7 The in operator 54 11.9 Equality Operators 54 11.9.1 The Equals Operator ( ==) 55 11.9.2 The Does-not-equals Operator ( !=) 55 11.9.3 The Abstract Equality Comparison Algorithm 55 11.9.4 The Strict Equals Operator ( ===) 56 11.9.5 The Strict Does-not-equal Operator ( !==) 56 11.9.6 The Strict Equality Comparison Algorithm 56 11.10 Binary Bitwise Operators 57 11.11 Binary Logical Operators 58 11.12 Conditional Operator ( ?: ) 58 11.13 Assignment Operators 59 11.13.1 Simple Assignment ( =) 59 11.13.2 Compound Assignment ( op=) 60 11.14 Comma Operator ( , ) 60 12 Statements 61 12.1 Block 61 12.2 Variable statement 62 12.3 Empty Statement 63 12.4 Expression Statement 63 12.5 The if Statement 63 12.6 Iteration Statements 64 12.6.1 The do-while Statement 64 12.6.2 The while statement 64 12.6.3 The for Statement 65 12.6.4 The for-in Statement 65 12.7 The continue Statement 66 12.8 The break Statement 67 12.9 The return Statement 67 12.10 The with Statement 67 12.11 The switch Statement 68 12.12 Labelled Statements 69 12.13 The throw statement 69 12.14 The try statement 70 13 Function Definition 71 13.1 Definitions 72 13.1.1 Equated Grammar Productions 72 13.1.2 Joined Objects 72 13.2 Creating Function Objects 72 13.2.1 [[Call]] 73 13.2.2 [[Construct]] 74 14 Program 75 15 Native ECMAScript Objects 76 15.1 The Global Object 76 15.1.1 Value Properties of the Global Object 77 15.1.2 Function Properties of the Global Object 77 15.1.3 URI Handling Function Properties 78 - v - 15.1.4 Constructor Properties of the Global Object 83 15.1.5 Other Properties of the Global Object 83 15.2 Object Objects 83 15.2.1 The Object Constructor Called as a Function 83 15.2.2 The Object Constructor 84 15.2.3 Properties of the Object Constructor 84 15.2.4 Properties of the Object Prototype Object 84 15.2.5 Properties of Object Instances 85 15.3 Function Objects 85 ';
+if(largeStr !== 'Standard ECMA-2623r d Edition - December 1999S t a n d a r d i z i n g Informat i o n and Commu n i c a t i o n SystemsPhone: +41 22 849.60.00 - Fax: +41 22 849.60.01 - URL: ht tp: / /www.ecma.ch - Internet: helpdesk@ecma.chECMAScript LanguageSpecificationStandard ECMA-2623r d Edition - December 1999S t a n d a r d i z i n g Informat i o n and Commu n i c a t i o n SystemsPhone: +41 22 849.60.00 - Fax: +41 22 849.60.01 - URL: ht tp: / /www.ecma.ch - Internet: helpdesk@ecma.chMB Ecma-262.doc 08-04-02 16,53ECMAScript LanguageSpecificationBrief HistoryThis ECMA Standard is based on several originating technologies, the most well known being JavaScript (Netscape)and JScript (Microsoft). The language was invented by Brendan Eich at Netscape and first appeared in thatcompans Navigator 2.0 browser. It has appeared in all subsequent browsers from Netscape and in all browsers fromMicrosoft starting with Internet Explorer 3.0.The development of this Standard started in November 1996. The first edition of this ECMA Standard was adopted bythe ECMA General Assembly of June 1997.That ECMA Standard was submitted to ISO/IEC JTC 1 for adoption under the fast-track procedure, and approved asinternational standard ISO/IEC 16262, in April 1998. The ECMA General Assembly of June 1998 approved thesecond edition of ECMA-262 to keep it fully aligned with ISO/IEC 16262. Changes between the first and the secondedition are editorial in nature.The current document defines the third edition of the Standard and includes powerful regular expressions, betterstring handling, new control statements, try/catch exception handling, tighter definition of errors, formatting fornumeric output and minor changes in anticipation of forthcoming internationalisation facilities and future languagegrowth.Work on the language is not complete. The technical committee is working on significant enhancements, includingmechanisms for scripts to be created and used across the Internet, and tighter coordination with other standards bodiessuch as groups within the World Wide Web Consortium and the Wireless Application Protocol Forum.This Standard has been adopted as 3rd Edition of ECMA-262 by the ECMA General Assembly in December, 1999.- i -Table of contents1 Scope 12 Conformance 13 References 14 Overview 1 4.1 Web Scripting 2 4.2 Language Overview 2 4.2.1 Objects 3 4.3 Definitions 4 4.3.1 Type 4 4.3.2 Primitive Value 4 4.3.3 Object 4 4.3.4 Constructor 4 4.3.5 Prototype 4 4.3.6 Native Object 4 4.3.7 Built-in Object 4 4.3.8 Host Object 4 4.3.9 Undefined Value 4 4.3.10 Undefined Type 4 4.3.11 Null Value 4 4.3.12 Null Type 4 4.3.13 Boolean Value 4 4.3.14 Boolean Type 4 4.3.15 Boolean Object 5 4.3.16 String Value 5 4.3.17 String Type 5 4.3.18 String Object 5 4.3.19 Number Value 5 4.3.20 Number Type 5 4.3.21 Number Object 5 4.3.22 Infinity 5 4.3.23 NaN 5 5 Notational Conventions 6 5.1 Syntactic and Lexical Grammars 6 5.1.1 Context-Free Grammars 6 5.1.2 The Lexical and RegExp Grammars 6 5.1.3 The Numeric String Grammar 6 5.1.4 The Syntactic Grammar 6 5.1.5 Grammar Notation 7 5.2 Algorithm Conventions 9 6. Source Text 10 7 Lexical Conventions 11 7.1 Unicode Format-Control Characters 11 7.2 White Space 11 7.3 Line Terminators 12 7.4 Comments 12 - ii - 7.5 Tokens 13 7.5.1 Reserved Words 13 7.5.2 Keywords 13 7.5.3 Future Reserved Words 14 7.6 Identifiers 14 7.7 Punctuators 15 7.8 Literals 16 7.8.1 Null Literals 16 7.8.2 Boolean Literals 16 7.8.3 Numeric Literals 16 7.8.4 String Literals 18 7.8.5 Regular Expression Literals 20 7.9 Automatic Semicolon Insertion 21 7.9.1 Rules of Automatic Semicolon Insertion 21 7.9.2 Examples of Automatic Semicolon Insertion 22 8 Types 24 8.1 The Undefined Type 24 8.2 The Null Type 24 8.3 The Boolean Type 24 8.4 The String Type 24 8.5 The Number Type 24 8.6 The Object Type 25 8.6.1 Property Attributes 25 8.6.2 Internal Properties and Methods 26 8.7 The Reference Type 29 8.7.1 GetValue (V) 29 8.7.2 PutValue (V, W) 29 8.8 The List Type 30 8.9 The Completion Type 30 9 Type Conversion 30 9.1 ToPrimitive 30 9.2 ToBoolean 30 9.3 ToNumber 31 9.3.1 ToNumber Applied to the String Type 31 9.4 ToInteger 34 9.5 ToInt32: (Signed 32 Bit Integer) 34 9.6 ToUint32: (Unsigned 32 Bit Integer) 34 9.7 ToUint16: (Unsigned 16 Bit Integer) 35 9.8 ToString 35 9.8.1 ToString Applied to the Number Type 35 9.9 ToObject 36 10 Execution Contexts 37 10.1 Definitions 37 10.1.1 Function Objects 37 10.1.2 Types of Executable Code 37 10.1.3 Variable Instantiation 37 10.1.4 Scope Chain and Identifier Resolution 38 10.1.5 Global Object 38 10.1.6 Activation Object 38 - i i i - 10.1.7 This 39 10.1.8 Arguments Object 39 10.2 Entering An Execution Context 39 10.2.1 Global Code 39 10.2.2 Eval Code 39 10.2.3 Function Code 39 11 Expressions 40 11.1 Primary Expressions 40 11.1.1 The this Keyword 40 11.1.2 Identifier Reference 40 11.1.3 Literal Reference 40 11.1.4 Array Initialiser 40 11.1.5 Object Initialiser 41 11.1.6 The Grouping Operator 42 11.2 Left-Hand-Side Expressions 43 11.2.1 Property Accessors 43 11.2.2 The new Operator 44 11.2.3 Function Calls 44 11.2.4 Argument Lists 45 11.2.5 Function Expressions 45 11.3 Postfix Expressions 45 11.3.1 Postfix Increment Operator 45 11.3.2 Postfix Decrement Operator 45 11.4 Unary Operators 46 11.4.1 The delete Operator 46 11.4.2 The void Operator 46 11.4.3 The typeof Operator 46 11.4.4 Prefix Increment Operator 47 11.4.5 Prefix Decrement Operator 47 11.4.6 Unary + Operator 47 11.4.7 Unary - Operator 47 11.4.8 Bitwise NOT Operator ( ~) 48 11.4.9 Logical NOT Operator ( !) 48 11.5 Multiplicative Operators 48 11.5.1 Applying the * Operator 48 11.5.2 Applying the / Operator 49 11.5.3 Applying the % Operator 49 11.6 Additive Operators 50 11.6.1 The Addition operator ( +) 50 11.6.2 The Subtraction Operator ( -) 50 11.6.3 Applying the Additive Operators ( +,- ) to Numbers 51 11.7 Bitwise Shift Operators 51 11.7.1 The Left Shift Operator ( <<) 51 11.7.2 The Signed Right Shift Operator ( >>) 51 11.7.3 The Unsigned Right Shift Operator ( >>>) 52 11.4 Relational Operators 52 11.8.1 The Less-than Operator ( <) 53 11.8.2 The Greater-than Operator ( >) 53 11.8.3 The Less-than-or-equal Operator ( <=) 53 11.8.4 The Greater-than-or-equal Operator ( >=) 53 11.8.5 The Abstract Relational Comparison Algorithm 53 - iv - 11.8.6 The instanceof operator 54 11.8.7 The in operator 54 11.9 Equality Operators 54 11.9.1 The Equals Operator ( ==) 55 11.9.2 The Does-not-equals Operator ( !=) 55 11.9.3 The Abstract Equality Comparison Algorithm 55 11.9.4 The Strict Equals Operator ( ===) 56 11.9.5 The Strict Does-not-equal Operator ( !==) 56 11.9.6 The Strict Equality Comparison Algorithm 56 11.10 Binary Bitwise Operators 57 11.11 Binary Logical Operators 58 11.12 Conditional Operator ( ?: ) 58 11.13 Assignment Operators 59 11.13.1 Simple Assignment ( =) 59 11.13.2 Compound Assignment ( op=) 60 11.14 Comma Operator ( , ) 60 12 Statements 61 12.1 Block 61 12.2 Variable statement 62 12.3 Empty Statement 63 12.4 Expression Statement 63 12.5 The if Statement 63 12.6 Iteration Statements 64 12.6.1 The do-while Statement 64 12.6.2 The while statement 64 12.6.3 The for Statement 65 12.6.4 The for-in Statement 65 12.7 The continue Statement 66 12.8 The break Statement 67 12.9 The return Statement 67 12.10 The with Statement 67 12.11 The switch Statement 68 12.12 Labelled Statements 69 12.13 The throw statement 69 12.14 The try statement 70 13 Function Definition 71 13.1 Definitions 72 13.1.1 Equated Grammar Productions 72 13.1.2 Joined Objects 72 13.2 Creating Function Objects 72 13.2.1 [[Call]] 73 13.2.2 [[Construct]] 74 14 Program 75 15 Native ECMAScript Objects 76 15.1 The Global Object 76 15.1.1 Value Properties of the Global Object 77 15.1.2 Function Properties of the Global Object 77 15.1.3 URI Handling Function Properties 78 - v - 15.1.4 Constructor Properties of the Global Object 83 15.1.5 Other Properties of the Global Object 83 15.2 Object Objects 83 15.2.1 The Object Constructor Called as a Function 83 15.2.2 The Object Constructor 84 15.2.3 Properties of the Object Constructor 84 15.2.4 Properties of the Object Prototype Object 84 15.2.5 Properties of Object Instances 85 15.3 Function Objects 85 '){
+  $ERROR('#2: Large string 8192 bytes');
+}
+//
+////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.4/S8.4_A7.1.js
@@ -0,0 +1,13 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * <LF> between chunks of one string not allowed
+ *
+ * @path ch08/8.4/S8.4_A7.1.js
+ * @description Insert <LF> between chunks of one string
+ * @negative
+ */
+
+eval("var x = asdf\u000Aghjk");
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.4/S8.4_A7.2.js
@@ -0,0 +1,13 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * <CR> between chunks of one string not allowed
+ *
+ * @path ch08/8.4/S8.4_A7.2.js
+ * @description Insert <CR> between chunks of one string
+ * @negative
+ */
+
+eval("var x = asdf\u000Dghjk");
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.4/S8.4_A7.3.js
@@ -0,0 +1,13 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * <PS> between chunks of one string not allowed
+ *
+ * @path ch08/8.4/S8.4_A7.3.js
+ * @description Insert <PS> between chunks of one string
+ * @negative
+ */
+
+eval("var x = asdf\u2028ghjk");
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.4/S8.4_A7.4.js
@@ -0,0 +1,13 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * <LS> between chunks of one string not allowed
+ *
+ * @path ch08/8.4/S8.4_A7.4.js
+ * @description Insert <LS> between chunks of one string
+ * @negative
+ */
+
+eval("var x = asdf\u2029ghjk");
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.4/S8.4_A8.js
@@ -0,0 +1,44 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * Empty string, 0, false are all equal (==) to each other, since they all evaluate to 0
+ *
+ * @path ch08/8.4/S8.4_A8.js
+ * @description Compare empty string with undefined, null, 0 and false
+ */
+
+var str='';
+
+////////////////////////////////////////////////////////////
+// CHECK#1
+if (str == undefined){
+  $ERROR('#1: Empty string and undefined are not equal (!=) to each other');
+}
+//
+/////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// CHECK#2
+if (str == null){
+  $ERROR('#1: Empty string and Null are not equal (!=) to each other');
+}
+//
+/////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// CHECK#3
+if (str != 0){
+  $ERROR('#3: Empty string and 0 are equal (==) to each other, since they all evaluate to 0');
+}
+//
+/////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// CHECK#4
+if (str != false){
+  $ERROR('#4: Empty string and false are equal (==) to each other, since they all evaluate to 0');
+}
+//
+/////////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.4/S8.4_A9_T1.js
@@ -0,0 +1,37 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * Assignment to string literals calls String constructor
+ *
+ * @path ch08/8.4/S8.4_A9_T1.js
+ * @description Simple string variable compare with object String
+ */
+
+var str='ABC';
+var strObj=new String('ABC');
+
+////////////////////////////////////////////////////////////
+// CHECK#1
+if (str.constructor !== strObj.constructor){
+  $ERROR('#1: \'ABC\'.constructor === new String(\'ABC\').constructor');
+}
+//
+/////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// CHECK#2
+if (str != strObj){
+  $ERROR('#2: "ABC" == new String("ABC")');
+}
+//
+/////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// CHECK#3
+if (str === strObj){
+  $ERROR('#3: "ABC" !== new String("ABC")');
+}
+//
+/////////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.4/S8.4_A9_T2.js
@@ -0,0 +1,62 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * Assignment to string literals calls String constructor
+ *
+ * @path ch08/8.4/S8.4_A9_T2.js
+ * @description Compare empty string variable, object String('') and object String()
+ */
+
+var str="";
+var strObj=new String("");
+var strObj_=new String();
+
+////////////////////////////////////////////////////////////
+// CHECK#1
+if (str.constructor !== strObj.constructor){
+  $ERROR('#1: "".constructor === new String("").constructor');
+}
+//
+/////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// CHECK#2
+if (str.constructor !== strObj_.constructor){
+  $ERROR('#2: "".constructor === new String().constructor');
+}
+//
+/////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// CHECK#3
+if (str != strObj){
+  $ERROR('#3: values of str=""; and strObj=new String(""); are equal');
+}
+//
+/////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// CHECK#4
+if (str === strObj){
+  $ERROR('#4: objects of str=""; and strObj=new String(""); are different');
+}
+//
+/////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// CHECK#5
+if (str != strObj_){
+  $ERROR('#5: values of str=""; and strObj=new String(); are equal');
+}
+//
+/////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// CHECK#6
+if (str === strObj_){
+  $ERROR('#6: objects of str=""; and strObj=new String(); are different');
+}
+//
+/////////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.4/S8.4_A9_T3.js
@@ -0,0 +1,46 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * Assignment to string literals calls String constructor
+ *
+ * @path ch08/8.4/S8.4_A9_T3.js
+ * @description Simple empty string variable compare with empty object String
+ */
+
+var str="";
+var strObj=new String;
+
+////////////////////////////////////////////////////////////
+// CHECK#1
+if (str.constructor !== strObj.constructor){
+  $ERROR('#1: "".constructor === new String.constructor');
+}
+//
+/////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// CHECK#2
+if (str != strObj){
+  $ERROR('#2: values of str=""; and strObj=new String(""); are equal');
+}
+//
+/////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+// CHECK#3
+if (str === strObj){
+  $ERROR('#3: objects of str=""; and strObj=new String(""); are different');
+}
+//
+/////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#4
+if (typeof str == typeof strObj){
+  $ERROR('#4: types of str=""; and strObj=new String(""); are different');
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+
new file mode 100644
new file mode 100644
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.5/8.5.1.js
@@ -0,0 +1,64 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.5/8.5.1.js
+ * @description Valid Number ranges
+ */
+
+// Check range support for Number values (IEEE 754 64-bit floats having the form s*m*2**e)
+//
+// For normalized floats, sign (s) is +1 or -1, m (mantisa) is a positive integer less 
+// than 2**53 but not less than 2**52 and e (exponent) is an integer ranging from -1074 to 971
+//
+// For denormalized floats, s is +1 or -1, m is a positive integer less than 2**52, and
+// e is -1074
+//
+// Below 64-bit float values shown for informational purposes.  Values may be positive or negative.
+// Infinity  >= ~1.797693134862315907729305190789e+308 >= 2**1024
+// MAX_NORM   = ~1.797693134862315708145274237317e+308  = (2**53 - 1) * (2**-52) * (2**1023) = (2**53-1) * (2**971) = (2**1024) - (2**971)
+// MIN_NORM   = ~2.2250738585072013830902327173324e-308 = 2**-1022
+// MAX_DENORM = ~2.2250738585072008890245868760859e-308 = MIN_NORM - MIN_DENORM = (2**-1022) - (2**-1074)
+// MIN_DENORM = ~4.9406564584124654417656879286822e-324 = 2**-1074
+ 
+// Fill an array with 2 to the power of (0 ... -1075)
+var value = 1;
+var floatValues = new Array(1076);
+for(var power = 0; power <= 1075; power++){
+	floatValues[power] = value;
+    // Use basic math operations for testing, which are required to support 'gradual underflow' rather
+    // than Math.pow etc..., which are defined as 'implementation dependent'.
+	value = value * 0.5;
+}
+
+// The last value is below min denorm and should round to 0, everything else should contain a value
+if(floatValues[1075] !== 0) {
+  $ERROR("Value after min denorm should round to 0");
+}
+
+// Validate the last actual value is min denorm
+if(floatValues[1074] !== 4.9406564584124654417656879286822e-324) {
+  $ERROR("Min denorm value is incorrect: " + floatValues[1074]);
+}
+
+// Validate that every value is half the value before it up to 1
+for(var index = 1074; index > 0; index--){
+  if(floatValues[index] === 0){
+	$ERROR("2**-" + index + " should not be 0");
+  }
+  if(floatValues[index - 1] !== (floatValues[index] * 2)){
+	$ERROR("Value should be double adjacent value at index " + index);
+  }
+}
+
+// Max norm should be supported and compare less than inifity
+if(!(1.797693134862315708145274237317e+308 < Infinity)){
+	$ERROR("Max Number value 1.797693134862315708145274237317e+308 should not overflow to infinity");
+}
+
+// Numbers closer to 2**1024 then max norm should overflow to infinity
+if(!(1.797693134862315808e+308 === +Infinity)){
+	$ERROR("1.797693134862315808e+308 did not resolve to Infinity");
+}
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.5/S8.5_A1.js
@@ -0,0 +1,21 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * NaN !== NaN
+ *
+ * @path ch08/8.5/S8.5_A1.js
+ * @description Compare NaN with NaN
+ */
+
+var x = Number.NaN;
+var x_ = Number.NaN;
+
+///////////////////////////////////////////////////////
+// CHECK #1
+if (x === x_){
+  $ERROR('#1: NaN !== NaN ');
+}
+//
+//////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.5/S8.5_A10.js
@@ -0,0 +1,14 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * Infinity is not a keyword
+ *
+ * @path ch08/8.5/S8.5_A10.js
+ * @description Create variable entitled Infinity
+ */
+
+var Infinity=1.0;
+Infinity='asdf';
+Infinity=true;
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.5/S8.5_A11_T1.js
@@ -0,0 +1,17 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * The integer 0 has two representations, +0 and -0
+ *
+ * @path ch08/8.5/S8.5_A11_T1.js
+ * @description Check 1.0/p_zero !== 1.0/n_zero
+ */
+
+var p_zero=+0;
+var n_zero=-0;
+
+if (1.0/p_zero === 1.0/n_zero){
+  $ERROR('#1: var p_zero=+0; var n_zero=-0; 1.0/p_zero !== 1.0/n_zero');
+}
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.5/S8.5_A11_T2.js
@@ -0,0 +1,38 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * The integer 0 has two representations, +0 and -0
+ *
+ * @path ch08/8.5/S8.5_A11_T2.js
+ * @description Compare positive_zero and negative_zero
+ */
+
+var p_zero=+0;
+var n_zero=-0;
+
+//CHECK #1
+if ((p_zero == n_zero) !== true){
+  $ERROR('#1: var p_zero=+0; var n_zero=-0; p_zero != n_zero');
+}
+
+//CHECK #2
+if ((n_zero == 0) !== true){
+  $ERROR('#2: var p_zero=+0; var n_zero=-0; n_zero == 0');
+}
+
+//CHECK #3
+if ((p_zero == -0) !== true){
+  $ERROR('#3: var p_zero=+0; var n_zero=-0; p_zero == -0');
+}
+
+//CHECK #4
+if ((p_zero === 0) !== true){
+  $ERROR('#4: var p_zero=+0; var n_zero=-0; p_zero === 0');
+}
+
+//CHECK #5
+if ((n_zero === -0) !== true){
+  $ERROR('#5: var p_zero=+0; var n_zero=-0; n_zero === -0');
+}
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.5/S8.5_A12.1.js
@@ -0,0 +1,23 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * +Infinity and Infinity are the same as Number.POSITIVE_INFINITY
+ *
+ * @path ch08/8.5/S8.5_A12.1.js
+ * @description Compare Infinity and +Infinity with Number.POSITIVE_INFINITY
+ */
+
+var p_inf=+Infinity;
+var inf=Infinity;
+
+//CHECK #1 
+if (p_inf!==Number.POSITIVE_INFINITY){
+  $ERROR('#1: +Infinity is the same as Number.POSITIVE_INFINITY');
+}
+
+//CHECK #2 
+if (inf!==Number.POSITIVE_INFINITY){
+  $ERROR('#2: Infinity is the same as Number.POSITIVE_INFINITY');
+}
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.5/S8.5_A12.2.js
@@ -0,0 +1,17 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * -Infinity is the same as Number.NEGATIVE_INFINITY
+ *
+ * @path ch08/8.5/S8.5_A12.2.js
+ * @description Compare -Infinity with Number.NEGATIVE_INFINITY
+ */
+
+var n_inf=-Infinity;
+
+//CHECK #1 
+if (n_inf !== Number.NEGATIVE_INFINITY){
+  $ERROR('#1: -Infinity is the same as Number.NEGATIVE_INFINITY');
+}
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.5/S8.5_A13_T2.js
@@ -0,0 +1,27 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * Finite nonzero values  that are Normalised having the form s*m*2**e
+ *  where s is +1 or -1, m is a positive integer less than 2**53 but not
+ *  less than s**52 and e is an integer ranging from -1074 to 971
+ *
+ * @path ch08/8.5/S8.5_A13_T2.js
+ * @description Finite Non zero values where e is 971
+ */
+
+//CHECK #1 
+if ((1*(Math.pow(2,52))*(Math.pow(2,971))) !== 8.98846567431158e+307){
+  $ERROR('#1: (1*(Math.pow(2,52))*(Math.pow(2,971))) === 8.98846567431158e+307. Actual: ' + ((1*(Math.pow(2,52))*(Math.pow(2,971)))));
+}
+
+//CHECK #2 
+if ((1*((Math.pow(2,53))-1)*(Math.pow(2,971))) !== 1.7976931348623157e+308){
+  $ERROR('#2: (1*((Math.pow(2,53))-1)*(Math.pow(2,971))) === 1.7976931348623157e+308. Actual: ' + ((1*((Math.pow(2,53))-1)*(Math.pow(2,971)))));
+}
+
+//CHECK #3 
+if ((-1*(Math.pow(2,52))*(Math.pow(2,971))) !== -8.98846567431158e+307){
+  $ERROR('#3: (-1*(Math.pow(2,52))*(Math.pow(2,971))) === -8.98846567431158e+307. Actual: ' + ((-1*(Math.pow(2,52))*(Math.pow(2,971)))));
+}
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.5/S8.5_A14_T1.js
@@ -0,0 +1,20 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * When number absolute value is bigger of 2**1024 should convert to Infinity
+ *
+ * @path ch08/8.5/S8.5_A14_T1.js
+ * @description Create number bigger of 2**1024
+ */
+
+//CHECK #1 
+if (1e+308*2 !== Infinity){
+  $ERROR('#1: 1e+308*2 === Infinity. Actual: ' + (1e+308*2));
+}
+
+//CHECK #2 
+if ((1*(Math.pow(2,53))*(Math.pow(2,971))) !== Infinity){
+  $ERROR('#2: (1*(Math.pow(2,53))*(Math.pow(2,971))) === Infinity. Actual: ' + ((1*(Math.pow(2,53))*(Math.pow(2,971)))));
+}
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.5/S8.5_A14_T2.js
@@ -0,0 +1,20 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * When number absolute value is bigger of 2**1024 should convert to Infinity
+ *
+ * @path ch08/8.5/S8.5_A14_T2.js
+ * @description Create number smaller of -2**1024
+ */
+
+//CHECK #1 
+if (-1e+308*3 !== -Infinity){
+  $ERROR('#1: -1e+308*3 === Infinity. Actual: ' + (-1e+308*3));
+}
+
+//CHECK #2 
+if ((-1*(Math.pow(2,53))*(Math.pow(2,971))) !== -Infinity){
+  $ERROR('#2: (-1*(Math.pow(2,53))*(Math.pow(2,971))) === Infinity. Actual: ' + ((-1*(Math.pow(2,53))*(Math.pow(2,971)))));
+}
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.5/S8.5_A2.1.js
@@ -0,0 +1,19 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * Number type represented as the double precision 64-bit format IEEE 754
+ *
+ * @path ch08/8.5/S8.5_A2.1.js
+ * @description Use 2^53 + 2 number and do some operation with it
+ */
+
+var x = 9007199254740994.0; /* 2^53 + 2 */
+var y = 1.0 - 1/65536.0;
+var z = x + y;
+var d = z - x;
+
+if (d !== 0){
+  $ERROR('#1: var x = 9007199254740994.0; var y = 1.0 - 1/65536.0; var z = x + y; var d = z - x; d === 0. Actual: ' + (d));
+}
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.5/S8.5_A2.2.js
@@ -0,0 +1,19 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * Number type represented as the extended precision 64-bit format IEEE 754
+ *
+ * @path ch08/8.5/S8.5_A2.2.js
+ * @description Use 2^53 + 2 number and do some operation with it
+ */
+
+var x = 9007199254740994.0; /* 2^53 + 2 */
+var y = 1.0 - 1/65536.0;
+var z = x + y;
+var d = z - x;
+
+if (d === 2){
+  $ERROR('#1: var x = 9007199254740994.0; var y = 1.0 - 1/65536.0; var z = x + y; var d = z - x; d !== 2');
+}
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.5/S8.5_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.
+
+/**
+ * NaN expression has a type Number
+ *
+ * @path ch08/8.5/S8.5_A3.js
+ * @description Check type of NaN
+ */
+
+var x=NaN;
+
+///////////////////////////////////////////////////////
+// CHECK#1
+if (typeof(x) !== "number"){
+  $ERROR('#1: var x=NaN; typeof(x) === "number". Actual: ' + (typeof(x)));
+}
+//
+//////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////
+// CHECK#2
+if (typeof(NaN) !== "number"){
+  $ERROR('#2: typeof(NaN) === "number". Actual: ' + (typeof(NaN)));
+}
+//
+//////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.5/S8.5_A4.js
@@ -0,0 +1,15 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * NaN is not a keyword
+ *
+ * @path ch08/8.5/S8.5_A4.js
+ * @description Create variable entitled NaN
+ */
+
+var NaN=1.0;
+NaN='asdf';
+NaN=true;
+NaN=Number.NaN;
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.5/S8.5_A5.js
@@ -0,0 +1,57 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * NaN not greater or equal zero
+ *
+ * @path ch08/8.5/S8.5_A5.js
+ * @description Compare NaN with zero
+ */
+
+var x = NaN;
+var x_geq_0=(x >= 0.0);
+var x_leq_0=(x <= 0.0);
+var x_leq_0_OR_geq_0=(x <= 0.0)||(x >= 0.0);
+var x_geq_0_ADD_leq_0=(x >= 0.0) + (x <= 0.0);
+
+
+///////////////////////////////////////////////////
+// CHECK#1
+if (x_geq_0){
+  $ERROR('#1: NaN not greater or equal zero');
+} else {
+  $PRINT('#1: NaN not greater or equal zero');
+}
+//
+///////////////////////////////////////////////////
+
+///////////////////////////////////////////////////
+// CHECK#2
+if (x_leq_0){
+  $ERROR('#2: NaN not less or equal zero');
+} else {
+  $PRINT('#2: NaN not less or equal zero');
+}
+//
+///////////////////////////////////////////////////
+
+///////////////////////////////////////////////////
+// CHECK#3
+if (x_leq_0_OR_geq_0){
+  $ERROR('#3: NaN not less or equal zero OR greater or equal zero');
+} else {
+  $PRINT('#3: NaN not less or equal zero OR greater or equal zero');
+}
+//
+///////////////////////////////////////////////////
+
+///////////////////////////////////////////////////
+// CHECK#4
+if (x_geq_0_ADD_leq_0){
+  $ERROR('#4: NaN not less or equal zero ADD greater or equal zero');
+} else {
+  $PRINT('#4: NaN not less or equal zero ADD greater or equal zero');
+}
+//
+///////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.5/S8.5_A6.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.
+
+/**
+ * -Infinity expression has a type Number
+ *
+ * @path ch08/8.5/S8.5_A6.js
+ * @description Check type of -Infinity
+ */
+
+var x=-Infinity;
+
+///////////////////////////////////////////////////////
+// CHECK#1
+if (typeof(x) !== "number"){
+  $ERROR('#1: var x=-Infinity; typeof(x) === "number". Actual: ' + (typeof(x)));
+}
+//
+//////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////
+// CHECK#2
+if (typeof(-Infinity) !== "number"){
+  $ERROR('#2: typeof(-Infinity) === "number". Actual: ' + (typeof(-Infinity)));
+}
+//
+//////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.5/S8.5_A7.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.
+
+/**
+ * +Infinity expression has a type Number
+ *
+ * @path ch08/8.5/S8.5_A7.js
+ * @description Check type of +Infinity
+ */
+
+var x=+Infinity;
+
+///////////////////////////////////////////////////////
+// CHECK#1
+if (typeof(x) !== "number"){
+  $ERROR('#1: var x=+Infinity; typeof(x) === "number". Actual: ' + (typeof(x)));
+}
+//
+//////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////
+// CHECK#2
+if (typeof(+Infinity) !== "number"){
+  $ERROR('#2: typeof(+Infinity) === "number". Actual: ' + (typeof(+Infinity)));
+}
+//
+//////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.5/S8.5_A8.js
@@ -0,0 +1,21 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * Infinity is the same as +Infinity
+ *
+ * @path ch08/8.5/S8.5_A8.js
+ * @description Compare Infinity and +Infinity
+ */
+
+var p_inf=+Infinity;
+var inf=Infinity;
+
+///////////////////////////////////////////////////////
+// 
+if (p_inf!==inf){
+  $ERROR('#1: Infinity is the same as +Infinity');
+}
+//
+//////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.5/S8.5_A9.js
@@ -0,0 +1,17 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * Globally defined variable NaN has not been altered by program execution
+ *
+ * @path ch08/8.5/S8.5_A9.js
+ * @description Try alter globally defined variable NaN
+ * @noStrict
+ */
+
+Number.NaN = 1;
+
+if (Number.NaN === 1) {
+  $ERROR('#1: Globally defined variable NaN has not been altered by program execution');
+}
+
new file mode 100644
new file mode 100644
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.6/8.6.1/S8.6.1_A1.js
@@ -0,0 +1,17 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * A property can have attribute ReadOnly like E in Math
+ *
+ * @path ch08/8.6/8.6.1/S8.6.1_A1.js
+ * @description Try change Math.E property
+ * @noStrict
+ */
+
+var __e = Math.E;
+Math.E=1;
+if (Math.E !==__e){
+  $ERROR('#1: __e = Math.E; Math.E=1; Math.E ===__e');
+}
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.6/8.6.1/S8.6.1_A2.js
@@ -0,0 +1,17 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * A property can have attribute DontEnum like all properties of Number
+ *
+ * @path ch08/8.6/8.6.1/S8.6.1_A2.js
+ * @description Try to enumerate properties of Number
+ */
+
+//CHECK#1
+var count=0;
+for (p in Number) count++;
+if (count > 0){
+  $ERROR('#1: count=0; for (p in Number) count++; count > 0. Actual: ' + (count));
+}
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.6/8.6.1/S8.6.1_A3.js
@@ -0,0 +1,27 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * A property can have attribute DontDelete like NaN propertie of Number object
+ *
+ * @path ch08/8.6/8.6.1/S8.6.1_A3.js
+ * @description Try to delete Number.NaN
+ * @noStrict
+ */
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+if (delete Number.NaN !== false){
+  $ERROR('#1: delete Number.NaN === false. Actual: ' + (delete Number.NaN));
+};
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#2
+if (typeof(Number.NaN) === "undefined"){
+  $ERROR('#2: delete Number.NaN; typeof(Number.NaN) !== "undefined" ');
+};
+//
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
new file mode 100644
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.6/8.6.2/S8.6.2_A1.js
@@ -0,0 +1,73 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * Native ECMAScript objects have an internal property called [[Prototype]]. The value of this property is
+ * either null or an object and is used for implementing inheritance
+ *
+ * @path ch08/8.6/8.6.2/S8.6.2_A1.js
+ * @description Check [[Prototype]] property of object
+ */
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+var __obj={};
+if (!Object.prototype.isPrototypeOf(__obj)){
+  $ERROR('#1: Native ECMAScript objects have an internal property called [[Prototype]]. ');
+};
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//Establish proto (base) object
+/*function ProtoObj(){
+  
+};*/
+var protoObj={};
+//Establish foo object
+function FooObj(){};
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#2
+// Invoke instance of foo object
+var obj__= new FooObj;
+
+if (!Object.prototype.isPrototypeOf(obj__)){
+  $ERROR('#2.1: protoObj={}; function FooObj(){}; var obj__= new FooObj; Object.prototype.isPrototypeOf(obj__) === true. Actual: ' + (Object.prototype.isPrototypeOf(obj__)));
+};
+
+if (!FooObj.prototype.isPrototypeOf(obj__)){
+  $ERROR('#2.2: protoObj={}; function FooObj(){}; var obj__= new FooObj; FooObj.prototype.isPrototypeOf(obj__) === true. Actual: ' + (FooObj.prototype.isPrototypeOf(obj__)));
+};
+
+if (protoObj.isPrototypeOf(obj__)){
+  $ERROR('#2.3: protoObj={}; function FooObj(){}; var obj__= new FooObj; protoObj.isPrototypeOf(obj__) === false. Actual: ' + (protoObj.isPrototypeOf(obj__)));
+};
+// Establish inheritance from proto object
+FooObj.prototype=protoObj;
+
+if (protoObj.isPrototypeOf(obj__)){
+  $ERROR('#2.4: protoObj={}; function FooObj(){}; var obj__= new FooObj; FooObj.prototype=protoObj; protoObj.isPrototypeOf(obj__) === false. Actual: ' + (protoObj.isPrototypeOf(obj__)));
+};
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#3
+
+// Invoke instance of foo object
+var __foo=new FooObj;
+
+if (!Object.prototype.isPrototypeOf(__foo)){
+  $ERROR('#3.1: protoObj={}; function FooObj(){}; var obj__= new FooObj; FooObj.prototype=protoObj; var __foo=new FooObj; Object.prototype.isPrototypeOf(__foo) === true. Actual: ' + (Object.prototype.isPrototypeOf(__foo)));
+};
+
+if (!FooObj.prototype.isPrototypeOf(__foo)){
+  $ERROR('#3.2: protoObj={}; function FooObj(){}; var obj__= new FooObj; FooObj.prototype=protoObj; var __foo=new FooObj; FooObj.prototype.isPrototypeOf(__foo) === true. Actual: ' + (FooObj.prototype.isPrototypeOf(__foo)));
+};
+
+if (!protoObj.isPrototypeOf(__foo)){
+  $ERROR('#3.3: protoObj={}; function FooObj(){}; var obj__= new FooObj; FooObj.prototype=protoObj; var __foo=new FooObj; protoObj.isPrototypeOf(__foo) === true. Actual: ' + (protoObj.isPrototypeOf(__foo)));
+};
+//
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.6/8.6.2/S8.6.2_A2.js
@@ -0,0 +1,37 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * Properties of the [[Prototype]] object
+ * are visible as properties of the child object for the purposes of get access, but not for put access
+ *
+ * @path ch08/8.6/8.6.2/S8.6.2_A2.js
+ * @description Check visibility properties of the child object for the purposes of get access, but not for put access
+ */
+
+//Establish foo object
+function FooObj(){};
+FooObj.prototype.prop="some";
+
+// Invoke instance of foo object
+var foo= new FooObj;
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+if (foo.prop !== "some"){
+  $ERROR('#1: function FooObj(){}; FooObj.prototype.prop="some"; var foo= new FooObj; foo.prop === "some". Actual: ' + (foo.prop));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#2
+foo.prop=true;
+// Invoke another instance of foo object
+var foo__ = new FooObj;
+if (foo__.prop !== "some"){
+  $ERROR('#2: function FooObj(){}; FooObj.prototype.prop="some"; var foo= new FooObj; foo.prop=true; var foo__ = new FooObj; foo__.prop === "some". Actual: ' + (foo__.prop));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.6/8.6.2/S8.6.2_A3.js
@@ -0,0 +1,19 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * The specification does not provide any means for a program to access [[class]] value except through Object.prototype.toString
+ *
+ * @path ch08/8.6/8.6.2/S8.6.2_A3.js
+ * @description Get [[class]] value except through Object.prototype.toString
+ */
+
+var __obj={};
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+if (__obj.toString() !== "[object " + 'Object' + "]"){
+  $ERROR('#1: var __obj={}; __obj.toString() === "[object " + \'Object\' + "]". Actual: ' + (__obj.toString()));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.6/8.6.2/S8.6.2_A4.js
@@ -0,0 +1,53 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * [[HasInstance]] returns a boolean value indicating whether Value delegates behaviour to this object
+ *
+ * @path ch08/8.6/8.6.2/S8.6.2_A4.js
+ * @description Check that the obj instance of Object, but not instance
+ *  of Function, String, Number, Array
+ */
+
+var __obj={};
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+if (!(__obj instanceof Object)) {
+  $ERROR('#1: var __obj={}; (__obj instanceof Object) === true. Actual: ' + ((__obj instanceof Object)));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#2
+if (__obj instanceof Function) {
+  $ERROR('#2: var __obj={}; (__obj instanceof Function) === false. Actual: ' + ((__obj instanceof Function)));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#3
+if (__obj instanceof String) {
+  $ERROR('#3: var __obj={}; (__obj instanceof String) === false. Actual: ' + ((__obj instanceof String)));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#4
+if (__obj instanceof Number) {
+  $ERROR('#4: var __obj={}; (__obj instanceof Number) === false. Actual: ' + ((__obj instanceof Number)));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#5
+if (__obj instanceof Array) {
+  $ERROR('#5: var __obj={}; (__obj instanceof Array) === false. Actual: ' + ((__obj instanceof Array)));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.6/8.6.2/S8.6.2_A5_T1.js
@@ -0,0 +1,32 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * [[Call]] executes code associated with the object
+ *
+ * @path ch08/8.6/8.6.2/S8.6.2_A5_T1.js
+ * @description Call function-property of object, property defined
+ *  as testScreen = {touch:function(){count++}}
+ */
+
+this.count=0;
+
+var testScreen = {touch:function(){count++}};
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+testScreen.touch();
+if (count !==1) {
+  $ERROR('#1: this.count=0; testScreen = {touch:function(){count++}}; testScreen.touch(); count === 1. Actual: ' + (count));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#2
+testScreen['touch']();
+if (count !==2) {
+  $ERROR('#2: this.count=0; testScreen = {touch:function(){count++}}; testScreen.touch(); testScreen[\'touch\'](); count === 2. Actual: ' + (count));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.6/8.6.2/S8.6.2_A5_T2.js
@@ -0,0 +1,32 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * [[Call]] executes code associated with the object
+ *
+ * @path ch08/8.6/8.6.2/S8.6.2_A5_T2.js
+ * @description Call function-property of object, property defined
+ *  as seat['move']=function(){position++}
+ */
+
+this.position=0;
+var seat = {};
+seat['move']=function(){position++};
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+seat.move();
+if (position !==1) {
+  $ERROR('#1: this.position=0; seat = {}; seat[\'move\']=function(){position++}; seat.move(); position === 1. Actual: ' + (position));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#2
+seat['move']();
+if (position !==2) {
+  $ERROR('#2: this.position=0; seat = {}; seat[\'move\']=function(){position++}; seat.move(); seat[\'move\'](); position === 2. Actual: ' + (position));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.6/8.6.2/S8.6.2_A5_T3.js
@@ -0,0 +1,31 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * [[Call]] executes code associated with the object
+ *
+ * @path ch08/8.6/8.6.2/S8.6.2_A5_T3.js
+ * @description Call function-property of global object, property defined
+ *  as knock=function(){count++}
+ */
+
+var count=0;
+var knock=function(){count++};
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+knock();
+if (count !==1) {
+  $ERROR('#1: count=0; knock=function(){count++}; knock(); count === 1. Actual: ' + (count));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#2
+this['knock']();
+if (count !==2) {
+  $ERROR('#2: count=0; knock=function(){count++}; knock(); this[\'knock\'](); count === 2. Actual: ' + (count));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.6/8.6.2/S8.6.2_A5_T4.js
@@ -0,0 +1,32 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * [[Call]] executes code associated with the object
+ *
+ * @path ch08/8.6/8.6.2/S8.6.2_A5_T4.js
+ * @description Call function-property of global object, property defined
+ *  as this['beep']=function(){__count++}
+ */
+
+var __count=0;
+
+this["beep"]=function(){__count++};
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+beep();
+if (__count !==1) {
+  $ERROR('#1: __count=0; this["beep"]=function(){__count++}; beep(); __count === 1. Actual: ' + (__count));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#2
+this["beep"]();
+if (__count !==2) {
+  $ERROR('#2: __count=0; this["beep"]=function(){__count++}; beep(); this["beep"](); __count === 2. Actual: ' + (__count));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.6/8.6.2/S8.6.2_A6.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.
+
+/**
+ * [[Construct]] constructs an object. Invoked via the new operator. Objects that implement this internal method are called constructors
+ *
+ * @path ch08/8.6/8.6.2/S8.6.2_A6.js
+ * @description Create a few Objects via the new operator
+ */
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+var objInstance=new Object;
+if (objInstance.constructor !== Object){
+  $ERROR('#1: var objInstance=new Object; objInstance.constructor === Object. Actual: ' + (objInstance.constructor));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#2
+var numInstance=new Number;
+if (numInstance.constructor !== Number){
+  $ERROR('#2: var numInstance=new Number; numInstance.constructor === Number. Actual: ' + (numInstance.constructor));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.6/8.6.2/S8.6.2_A7.js
@@ -0,0 +1,17 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * Objects that implement internal method [[Construct]] are called constructors. Math object is NOT constructor
+ *
+ * @path ch08/8.6/8.6.2/S8.6.2_A7.js
+ * @description Checking if execution of "var objMath=new Math" passes
+ * @negative
+ */
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+var objMath=new Math;
+
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.6/8.6.2/S8.6.2_A8.js
@@ -0,0 +1,22 @@
+// Copyright 2011 Google Inc.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * @path ch08/8.6/8.6.2/S8.6.2_A8.js
+ * @description It should not be possible to change the [[Prototype]]
+ * of a non-extensible object
+ */
+
+var x = Object.preventExtensions({});
+var y = {};
+try {
+  x.__proto__ = y;
+} catch (err) {
+  // As far as this test is concerned, we allow the above assignment
+  // to fail. This failure does violate the spec and should probably
+  // be tested separately.
+}
+if (Object.getPrototypeOf(x) !== Object.prototype) {
+  $ERROR("Prototype of non-extensible object mutated");
+}
+
new file mode 100644
new file mode 100644
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.6/S8.6_A2_T1.js
@@ -0,0 +1,23 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * Do not crash with postincrement custom property
+ *
+ * @path ch08/8.6/S8.6_A2_T1.js
+ * @description Try to implement postincrement for custom property
+ */
+
+var __map={foo:"bar"};
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+
+__map.foo++;
+if (!isNaN(__map.foo)) {
+  $ERROR('#1: var __map={foo:"bar"}; __map.foo++; __map.foo === Not-a-Number. Actual: ' + (__map.foo));
+}
+
+//
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.6/S8.6_A2_T2.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.
+
+/**
+ * Do not crash with postincrement custom property
+ *
+ * @path ch08/8.6/S8.6_A2_T2.js
+ * @description Try to implement postincrement for not declared custom property
+ */
+
+var __map={};
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+if (!isNaN(__map.foo++)) {
+  $ERROR('#1: var __map={}; __map.foo === Not-a-Number. Actual: ' + (__map.foo));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#2
+if (!("foo" in __map)) {
+  $ERROR('#2: var __map={}; "foo" in __map');
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.6/S8.6_A3_T1.js
@@ -0,0 +1,23 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * Do not crash with pefixincrement custom property
+ *
+ * @path ch08/8.6/S8.6_A3_T1.js
+ * @description Try to implement pefixincrement for custom property
+ */
+
+var __map={foo:'bar'};
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+
+++__map.foo;
+if (!isNaN(__map.foo)) {
+  $ERROR('#1:  var __map={foo:"bar"}; ++__map.foo; __map.foo === Not-a-Number. Actual: ' + (__map.foo));
+}
+
+//
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.6/S8.6_A3_T2.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.
+
+/**
+ * Do not crash with pefixincrement custom property
+ *
+ * @path ch08/8.6/S8.6_A3_T2.js
+ * @description Try to implement pefixincrement for not declared custom property
+ */
+
+var __map={};
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+if (!isNaN(++__map.foo)) {
+  $ERROR('#1:  var __map={}; __map.foo++; __map.foo === Not-a-Number. Actual: ' + (__map.foo));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#2
+if (!("foo" in __map)) {
+  $ERROR('#2: var __map={}; "foo" in __map');
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.6/S8.6_A4_T1.js
@@ -0,0 +1,57 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * An Object is an unordered collection of properties
+ *
+ * @path ch08/8.6/S8.6_A4_T1.js
+ * @description Simple using a few custom properties
+ */
+
+///////////////////////////////////////////////////////
+// CHECK#1
+var obj = {bar:true, some:1, foo:"a"};
+
+var count=0;
+
+for (property in obj)	count++;
+
+if (count !== 3){
+  $ERROR('#1: obj = {bar:true, some:1, foo:"a"}; count=0; for (property in obj) count++; count === 3. Actual: ' + (count));
+}
+//
+////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////
+// CHECK#2
+var obj_ = {bar:true};
+obj_.some = 1;
+obj_.foo = "a";
+
+count=0;
+
+for (property in obj_) count++;
+
+if (count !== 3){
+  $ERROR('#2: obj_ = {bar:true}; obj_.some = 1; obj_.foo = "a"; count=0; for (property in obj_) count++; count === 3. Actual: ' + (count));
+}
+//
+////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////
+// CHECK#3
+var obj__ = new Object();
+obj__.bar = true;
+obj__.some = 1;
+obj__.foo = "a";
+
+count=0;
+
+for (property in obj__)	count++;
+
+if (count !== 3){
+  $ERROR('#3: obj__ = new Object(); obj__.bar = true; obj__.some = 1; obj__.foo = "a"; for (property in obj__)  count++; count === 3. Actual: ' + (count));
+}
+//
+////////////////////////////////////////////////////////
+
new file mode 100644
new file mode 100644
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.7/8.7.2/8.7.2-1-s.js
@@ -0,0 +1,22 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.7/8.7.2/8.7.2-1-s.js
+ * @description Strict Mode - ReferenceError is thrown if LeftHandSide evaluates to an unresolvable Reference
+ * @onlyStrict
+ */
+
+
+function testcase() {
+        "use strict";
+        try {
+            eval("_8_7_2_1 = 11;");
+            return false;
+        } catch (e) {
+            return e instanceof ReferenceError;
+        }
+    }
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.7/8.7.2/8.7.2-2-s.js
@@ -0,0 +1,18 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.7/8.7.2/8.7.2-2-s.js
+ * @description Strict Mode - ReferenceError isn't thrown if LeftHandSide evaluates to a resolvable Reference
+ * @onlyStrict
+ */
+
+
+function testcase() {
+        "use strict";
+        var b = 11;
+        return b === 11;
+    }
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.7/8.7.2/8.7.2-3-1-s.js
@@ -0,0 +1,19 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.7/8.7.2/8.7.2-3-1-s.js
+ * @description eval - a property named 'eval' is permitted
+ * @onlyStrict
+ */
+
+
+function testcase() {
+  'use strict';
+
+  var o = { eval: 42};
+  return true;
+ }
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.7/8.7.2/8.7.2-3-a-1gs.js
@@ -0,0 +1,15 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+
+/**
+ * @path ch08/8.7/8.7.2/8.7.2-3-a-1gs.js
+ * @description Strict Mode - ReferenceError is thrown if LeftHandSide evaluate to an unresolvable Reference
+ * @onlyStrict
+ * @negative .
+ */
+
+"use strict";
+b = 11;
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.7/8.7.2/8.7.2-3-a-2gs.js
@@ -0,0 +1,16 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+
+/**
+ * @path ch08/8.7/8.7.2/8.7.2-3-a-2gs.js
+ * @description Strict Mode - 'runtime' error is thrown before LeftHandSide evaluates to an unresolvable Reference
+ * @onlyStrict
+ * @negative NotEarlyError
+ */
+
+"use strict";
+throw NotEarlyError;
+b = 11;
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.7/8.7.2/8.7.2-3-s.js
@@ -0,0 +1,27 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.7/8.7.2/8.7.2-3-s.js
+ * @description Strict Mode - TypeError is thrown if LeftHandSide is a reference to a non-writable data property
+ * @onlyStrict
+ */
+
+
+function testcase() {
+        "use strict";
+        var _8_7_2_3 = {};
+        Object.defineProperty(_8_7_2_3, "b", {
+            writable: false
+        });
+
+        try {
+            _8_7_2_3.b = 11;
+            return false;
+        } catch (e) {
+            return e instanceof TypeError;
+        }
+    }
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.7/8.7.2/8.7.2-4-s.js
@@ -0,0 +1,28 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.7/8.7.2/8.7.2-4-s.js
+ * @description Strict Mode - TypeError is thrown if LeftHandSide is a reference to an accessor property with no setter
+ * @onlyStrict
+ */
+
+
+function testcase() {
+        "use strict";
+        var _8_7_2_4 = {};
+        var _8_7_2_4_bValue = 1;
+        Object.defineProperty(_8_7_2_4, "b", {
+            get: function () { return _8_7_2_4_bValue; }
+        });
+
+        try {
+            _8_7_2_4.b = 11;
+            return false;
+        } catch (e) {
+            return e instanceof TypeError;
+        }
+    }
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.7/8.7.2/8.7.2-5-s.js
@@ -0,0 +1,25 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.7/8.7.2/8.7.2-5-s.js
+ * @description Strict Mode - TypeError is thrown if LeftHandSide is a reference to a non-existent property of an non-extensible object
+ * @onlyStrict
+ */
+
+
+function testcase() {
+        "use strict";
+        var _8_7_2_5 = {};
+        Object.preventExtensions(_8_7_2_5);
+
+        try {
+            _8_7_2_5.b = 11;
+            return false;
+        } catch (e) {
+            return e instanceof TypeError;
+        }
+    }
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.7/8.7.2/8.7.2-6-s.js
@@ -0,0 +1,24 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.7/8.7.2/8.7.2-6-s.js
+ * @description Strict Mode - TypeError isn't thrown if LeftHandSide is a reference to a writable data property
+ * @onlyStrict
+ */
+
+
+function testcase() {
+        "use strict";
+        var _8_7_2_6 = {};
+        Object.defineProperty(_8_7_2_6, "b", {
+            writable: true
+        });
+
+        _8_7_2_6.b = 11;
+
+        return _8_7_2_6.b === 11;
+    }
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.7/8.7.2/8.7.2-7-s.js
@@ -0,0 +1,25 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.7/8.7.2/8.7.2-7-s.js
+ * @description Strict Mode - TypeError isn't thrown if LeftHandSide is a reference to an accessor property with setter
+ * @onlyStrict
+ */
+
+
+function testcase() {
+        "use strict";
+        var _8_7_2_7 = {};
+        var _8_7_2_7_bValue = 1;
+        Object.defineProperty(_8_7_2_7, "b", {
+            get: function () { return _8_7_2_7_bValue; },
+            set: function (value) { _8_7_2_7_bValue = value; }
+        });
+
+        _8_7_2_7.b = 11;
+        return _8_7_2_7.b === 11;
+    }
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.7/8.7.2/8.7.2-8-s.js
@@ -0,0 +1,21 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch08/8.7/8.7.2/8.7.2-8-s.js
+ * @description Strict Mode - TypeError isn't thrown if LeftHandSide is a reference to a property of an extensible object
+ * @onlyStrict
+ */
+
+
+function testcase() {
+        "use strict";
+        var _8_7_2_8 = {};
+
+        _8_7_2_8.b = 11;
+
+        return _8_7_2_8.b === 11;
+    }
+runTestCase(testcase);
new file mode 100644
new file mode 100644
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.7/S8.7.1_A1.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.
+
+/**
+ * Delete operator deletes pure property, so it returns true to be applyed to this.property
+ *
+ * @path ch08/8.7/S8.7.1_A1.js
+ * @description Try to delete this.y, where y is this.y=1
+ */
+
+this.y = 1;
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+if((delete this.y) !== true){
+  $ERROR('#1: this.y = 1; (delete this.y) === true. Actual: ' + ((delete this.y)));
+};
+//
+//////////////////////////////////////////////////////////////////////////////
+
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#2
+if (this.y !== undefined){
+  $ERROR('#2: this.y = 1; (delete this.y) === true; this.y === undefined. Actual: ' + (this.y));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.7/S8.7.1_A2.js
@@ -0,0 +1,29 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * Delete operator can't delete reference, so it returns false to be applyed to reference
+ *
+ * @path ch08/8.7/S8.7.1_A2.js
+ * @description Try to delete y, where y is var y=1
+ * @noStrict
+ */
+
+var y = 1;
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+if(delete y){
+  $ERROR('#1: y = 1; (delete y) === false. Actual: ' + ((delete y)));
+};
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#2
+if (y !== 1) {
+  $ERROR('#2: y = 1; delete y; y === 1. Actual: ' + (y));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.7/S8.7.2_A1_T1.js
@@ -0,0 +1,13 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * GetValue(V) mast fail
+ *
+ * @path ch08/8.7/S8.7.2_A1_T1.js
+ * @description Checking if execution of "'litera'=1;" fails
+ * @negative
+ */
+
+'litera'=1;
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.7/S8.7.2_A1_T2.js
@@ -0,0 +1,13 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * GetValue(V) mast fail
+ *
+ * @path ch08/8.7/S8.7.2_A1_T2.js
+ * @description Checking if execution of "1=1" fails
+ * @negative
+ */
+
+1=1;
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.7/S8.7.2_A2.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.
+
+/**
+ * x++ calls GetValue then PutValue so after applying postfix increment(actually conrete operator type is unimportant)
+ * we must have reference to defined value
+ *
+ * @path ch08/8.7/S8.7.2_A2.js
+ * @description Execute x++, where x is var x
+ */
+
+var x;
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+if (x !== undefined) {
+  $ERROR('#1: var x; x === undefined. Actual: ' + (x));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+x++;
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#2
+if (x === undefined) {
+  $ERROR('#2: var x; x++; x !== undefined');
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.7/S8.7.2_A3.js
@@ -0,0 +1,27 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * this.x++ calls GetValue then PutValue so after applying postfix increment(actually conrete operator type is unimportan)
+ * we must have reference to defined value
+ *
+ * @path ch08/8.7/S8.7.2_A3.js
+ * @description Execute this.x++, where this.x is undefined
+ */
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+if (this.x !== undefined) {
+  $ERROR('#1: this.x === undefined. Actual: ' + (this.x));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+this.x++;
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#2
+if (x === undefined) {
+  $ERROR('#2: this.x; this.x++; x !== undefined');
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.7/S8.7_A1.js
@@ -0,0 +1,30 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * Multiple Variables should Referring to a Single Object
+ *
+ * @path ch08/8.7/S8.7_A1.js
+ * @description Create object and refers to the other object, modify a property in the original object.
+ *  We now see that that change is represented in both variables
+ */
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#
+// Set obj to an empty object
+//
+var obj = new Object();
+// objRef now refers to the other object
+//
+var objRef = obj;
+// Modify a property in the original object
+objRef.oneProperty = -1;
+obj.oneProperty = true;
+// We now see that that change is represented in both variables
+// (Since they both refer to the same object)
+if(objRef.oneProperty !== true){
+  $ERROR('#1: var obj = new Object(); var objRef = obj; objRef.oneProperty = -1; obj.oneProperty = true; objRef.oneProperty === true. Actual: ' + (objRef.oneProperty));
+};
+//
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.7/S8.7_A2.js
@@ -0,0 +1,42 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * Reference to Self-Modifying Object remain the integrity
+ *
+ * @path ch08/8.7/S8.7_A2.js
+ * @description Create a reference to the array, and change original array
+ */
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+// Create an array of items
+var items = new Array( "one", "two", "three" );
+// Create a reference to the array of items
+var itemsRef = items;
+// Add an item to the original array
+items.push( "four" );var itemsRef = items;
+// The length of each array should be the same,
+// since they both point to the same array object
+if( itemsRef.length !== 4){
+  $ERROR('#1: var items = new Array( "one", "two", "three" ); var itemsRef = items; items.push( "four" );var itemsRef = items; itemsRef.length !== 4');
+};
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#
+// Create an array of items
+var items = new Array( "one", "two", "three" );
+// Create a reference to the array of items
+var itemsRef = items;
+// Add an item to the original array
+items[1]="duo";
+// The length of each array should be the same,
+// since they both point to the same array object
+if( itemsRef[1] !== "duo"){
+  $ERROR('#2: var items = new Array( "one", "two", "three" ); var itemsRef = items; items[1]="duo"; itemsRef[1] === "duo". Actual: ' + (itemsRef[1]));
+};
+//
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.7/S8.7_A3.js
@@ -0,0 +1,29 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * Changing the Reference of an Object While Maintaining Integrity
+ *
+ * @path ch08/8.7/S8.7_A3.js
+ * @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');
+};
+//
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.7/S8.7_A4.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.
+
+/**
+ * Object Modification Resulting in a New Object for Not a Self-Modified Object leads to loss of integrity
+ *
+ * @path ch08/8.7/S8.7_A4.js
+ * @description Create a reference to the string, and Concatenate some new text onto the string object
+ */
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#
+// Set item equal to a new string object
+var item = new String("test");
+// itemRef now refers to the same string object
+var itemRef = item;
+// Concatenate some new text onto the string object
+// NOTE: This creates a new object, and does not modify
+// the original object.
+item += "ing";
+// The values of item and itemRef are NOT equal, as a whole
+// new string object has been created
+if( item == itemRef ){
+  $ERROR('#1: var item = new String("test"); var itemRef = item; item += "ing"; item != itemRef');
+};
+//
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.7/S8.7_A5_T1.js
@@ -0,0 +1,54 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * Delete unary operator can't delete object to be referenced
+ *
+ * @path ch08/8.7/S8.7_A5_T1.js
+ * @description Delete referenced object, var __ref = obj
+ * @noStrict
+ */
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+if (typeof(__ref) !== "undefined"){
+    $ERROR('#1: typeof(__ref) === "undefined". Actual: ' + (typeof(__ref)));  
+}; 
+//
+//////////////////////////////////////////////////////////////////////////////
+
+var obj = new Object();
+var __ref = obj;
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#2
+if (typeof(__ref) === "undefined"){
+    $ERROR('#2: obj = new Object(); var __ref = obj; typeof(__ref) !== "undefined"');
+}; 
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#3
+if (delete __ref !== false){
+    $ERROR('#3: obj = new Object(); var __ref = obj; delete __ref === false. Actual: ' + (delete __ref));
+};
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#4
+if (typeof(__ref) !== "object"){
+    $ERROR('#4: obj = new Object(); var __ref = obj; delete __ref; typeof(__ref) === "object". Actual: ' + (typeof(__ref)));
+};
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#5
+if (typeof(obj) !== "object"){
+    $ERROR('#5: obj = new Object(); var __ref = obj; delete __ref; typeof(obj) === "object". Actual: ' + (typeof(obj)));
+};
+//
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.7/S8.7_A5_T2.js
@@ -0,0 +1,54 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * Delete unary operator can't delete object to be referenced
+ *
+ * @path ch08/8.7/S8.7_A5_T2.js
+ * @description Delete referenced object, __ref = obj
+ * @noStrict
+ */
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+if (typeof(__ref) !== "undefined"){
+    $ERROR('#1: typeof(__ref) === "undefined". Actual: ' + (typeof(__ref)));  
+}; 
+//
+//////////////////////////////////////////////////////////////////////////////
+
+var obj = new Object();
+__ref = obj;
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#2
+if (typeof(__ref) === "undefined"){
+    $ERROR('#2: obj = new Object(); __ref = obj; typeof(__ref) !== "undefined"');
+}; 
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#3
+if (delete __ref !== true){
+    $ERROR('#3: obj = new Object(); __ref = obj; delete __ref === true. Actual: ' + (delete __ref));
+};
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#4
+if (typeof(__ref) !== "undefined"){
+    $ERROR('#4: obj = new Object(); __ref = obj; delete __ref; typeof(__ref) === "undefined". Actual: ' + (typeof(__ref)));
+};
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#5
+if (typeof(obj) !== "object"){
+    $ERROR('#5: obj = new Object(); __ref = obj; delete __ref; typeof(obj) === "object". Actual: ' + (typeof(obj)));
+};
+//
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.7/S8.7_A6.js
@@ -0,0 +1,27 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * Passing arguments by value differs from by reference and do not change values to be passed
+ *
+ * @path ch08/8.7/S8.7_A6.js
+ * @description Adding original variable with referenced one inside function
+ */
+
+var n = 1;
+var m = n;
+
+function addFirst2Second(first, second){first += second;}
+
+addFirst2Second(n, m);
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+if (m !== 1) {
+  $ERROR('#1: var n = 1; var m = n; function addFirst2Second(first, second){first += second;} addFirst2Second(n, m); m === 1. Actual: ' + (m));
+}
+
+//
+//////////////////////////////////////////////////////////////////////////////
+
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.7/S8.7_A7.js
@@ -0,0 +1,35 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * Passing arguments by reference do change values of reference to be passed
+ *
+ * @path ch08/8.7/S8.7_A7.js
+ * @description Add new property to original variable inside function
+ */
+
+var n = {};
+var m = n;
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+if (typeof m !== "object") {
+  $ERROR('#1: var n = {}; var m = n; typeof m === "object". Actual: ' + (typeof m));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+function populateAge(person){person.age = 50;}
+
+populateAge(m);
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#2
+if (n.age !== 50) {
+  $ERROR('#2: var n = {}; var m = n; function populateAge(person){person.age = 50;} populateAge(m); n.age === 50. Actual: ' + (n.age));
+}
+
+//
+//////////////////////////////////////////////////////////////////////////////
+
+
new file mode 100644
new file mode 100644
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.8/S8.8_A2_T1.js
@@ -0,0 +1,19 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * Values of the List type are simply ordered sequences of values
+ *
+ * @path ch08/8.8/S8.8_A2_T1.js
+ * @description Call function __mFunc(1,2,3) with 3 arguments
+ */
+
+function __mFunc(){return arguments.length;};
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+if (__mFunc(1,2,3) !== 3){
+  $ERROR('#1: function __mFunc(){return arguments.length;}; __mFunc(1,2,3) === 3. Actual: ' + (__mFunc(1,2,3)));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.8/S8.8_A2_T2.js
@@ -0,0 +1,19 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * Values of the List type are simply ordered sequences of values
+ *
+ * @path ch08/8.8/S8.8_A2_T2.js
+ * @description Call function __mFunc([,,]) with 1 arguments
+ */
+
+function __mFunc(){return arguments.length;};
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+if (__mFunc([,,]) !== 1){
+  $ERROR('#1: function __mFunc(){return arguments.length;}; __mFunc([,,]) === 1. Actual: ' + (__mFunc([,,])));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.8/S8.8_A2_T3.js
@@ -0,0 +1,19 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * Values of the List type are simply ordered sequences of values
+ *
+ * @path ch08/8.8/S8.8_A2_T3.js
+ * @description Call function, that concatenate all it`s arguments
+ */
+
+function __mFunc(){var __accum=""; for (var i = 0; i < arguments.length; ++i){__accum += arguments[i]};return __accum;};
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+if (__mFunc("A","B","C","D","E","F") !== "ABCDEF"){
+  $ERROR('#1: function __mFunc(){var __accum=""; for (var i = 0; i < arguments.length; ++i){__accum += arguments[i]};return __accum;}; __mFunc("A","B","C","D","E","F") === "ABCDEF". Actual: ' + (__mFunc("A","B","C","D","E","F")));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
new file mode 100644
new file mode 100644
new file mode 100644
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch14/14.0/S14_A1.js
@@ -0,0 +1,35 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * FunctionExpression must be localed in a reacheable fragment of the program
+ *
+ * @path ch14/14.0/S14_A1.js
+ * @description Declaring a function within an "if" Expression
+ */
+
+var THERE = "I'm there";
+var HERE = "I'm here";
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+if ( __func !== undefined) {
+	$ERROR('#1: __func === undefined. Actual:  __func ==='+ __func  );
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+if (true){
+    var __func = function(){return HERE;};
+} else {
+    var __func = function (){return THERE;};
+};
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#2
+if (__func() !== HERE) {
+	$ERROR('#2: __func() === HERE. Actual:  __func() ==='+ __func()  );
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch14/14.0/S14_A2.js
@@ -0,0 +1,31 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * FunctionDeclaration cannot be localed inside an Expression
+ *
+ * @path ch14/14.0/S14_A2.js
+ * @description Declaring a function within an "if" Expression
+ */
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+if (typeof f !== 'undefined') {
+	$ERROR('#1: typeof f === \'undefined\'. Actual:  typeof f ==='+ typeof f  );
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#2
+if (function f(arg){
+	if (arg===0)
+	   return 1;
+	else
+	   return f(arg-1)*arg;
+}(3)!==6) {
+	$ERROR('#2: FunctionDeclaration cannot be localed inside an Expression');
+};
+//
+//////////////////////////////////////////////////////////////////////////////
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch14/14.0/S14_A3.js
@@ -0,0 +1,30 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * Global FunctionDeclaration cannot be defined within the body of another FunctionDeclaration
+ *
+ * @path ch14/14.0/S14_A3.js
+ * @description Declaring a function within the body of another function
+ */
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+if (typeof __func !== "function") {
+	$ERROR('#1: typeof __func === "function". Actual:  typeof __func ==='+ typeof __func  );
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#2
+if (typeof __gunc !== "undefined") {
+	$ERROR('#2: typeof __gunc === "undefined". Actual:  typeof __gunc ==='+ typeof __gunc  );
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+function __func(){
+    function __gunc(){return true};
+}
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch14/14.0/S14_A5_T1.js
@@ -0,0 +1,22 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * The Identifer within a FunctionDeclaration can be written in both letters and unicode
+ *
+ * @path ch14/14.0/S14_A5_T1.js
+ * @description Declaring a function with "function __\u0066\u0075\u006e\u0063(){return "both"}"
+ */
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+if (__func() !== "both") {
+	$ERROR('#1: __func() === "both". Actual:  __func() ==='+ __func()  );
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+function __func(){return "ascii"};
+function \u005f\u005f\u0066\u0075\u006e\u0063(){return "unicode"};//__func in unicode
+function __\u0066\u0075\u006e\u0063(){return "both"};//__func in unicode
+
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch14/14.0/S14_A5_T2.js
@@ -0,0 +1,21 @@
+// Copyright 2009 the Sputnik authors.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * The Identifer within a FunctionDeclaration can be written in both letters and unicode
+ *
+ * @path ch14/14.0/S14_A5_T2.js
+ * @description Declaring a function with "function \u005f\u005f\u0066\u0075\u006e\u0063(){return "unicode"}"
+ */
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+if (__func() !== "unicode") {
+	$ERROR('#1: __func() === "unicode". Actual:  __func() ==='+ __func()  );
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+function __func(){return "ascii"};
+function \u005f\u005f\u0066\u0075\u006e\u0063(){return "unicode"};//__func in unicode
+
new file mode 100644
new file mode 100644
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch14/14.1/14.1-1-s.js
@@ -0,0 +1,23 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch14/14.1/14.1-1-s.js
+ * @description 'use strict' directive - correct usage
+ * @noStrict
+ */
+
+
+function testcase() {
+
+  function foo()
+  {
+    'use strict';
+     return(this === undefined);
+  }
+
+  return foo.call(undefined);
+ }
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch14/14.1/14.1-10-s.js
@@ -0,0 +1,24 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch14/14.1/14.1-10-s.js
+ * @description other directives - may follow 'use strict' directive
+ * @noStrict
+ */
+
+
+function testcase() {
+
+  function foo()
+  {
+     "use strict";
+     "bogus directive";
+     return (this === undefined);
+  }
+
+  return foo.call(undefined);
+ }
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch14/14.1/14.1-11-s.js
@@ -0,0 +1,26 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch14/14.1/14.1-11-s.js
+ * @description comments may preceed 'use strict' directive
+ * @noStrict
+ */
+
+
+function testcase() {
+
+  function foo()
+  {
+     // comment
+     /* comment */ "use strict";
+
+   return(this === undefined);
+
+  }
+
+  return foo.call(undefined);
+ }
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch14/14.1/14.1-12-s.js
@@ -0,0 +1,24 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch14/14.1/14.1-12-s.js
+ * @description comments may follow 'use strict' directive
+ * @noStrict
+ */
+
+
+function testcase() {
+
+  function foo()
+  {
+     "use strict";    /* comment */   // comment
+
+     return (this === undefined);
+  }
+
+  return foo.call(undefined);
+ }
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch14/14.1/14.1-13-s.js
@@ -0,0 +1,23 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch14/14.1/14.1-13-s.js
+ * @description semicolon insertion works for'use strict' directive
+ * @noStrict
+ */
+
+
+function testcase() {
+
+  function foo()
+  {
+    "use strict"
+     return (this === undefined);
+  }
+
+  return foo.call(undefined);
+ }
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch14/14.1/14.1-14-s.js
@@ -0,0 +1,24 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch14/14.1/14.1-14-s.js
+ * @description semicolon insertion may come before 'use strict' directive
+ * @noStrict
+ */
+
+
+function testcase() {
+
+  function foo()
+  {
+    "another directive"
+    "use strict" ;
+    return (this === undefined);
+  }
+
+  return foo.call(undefined);
+ }
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch14/14.1/14.1-15-s.js
@@ -0,0 +1,29 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch14/14.1/14.1-15-s.js
+ * @description blank lines may come before 'use strict' directive
+ * @noStrict
+ */
+
+
+function testcase() {
+
+  function foo()
+  {
+
+
+
+
+
+
+    "use strict" ;
+    return (this === undefined);
+  }
+
+  return foo.call(undefined);
+ }
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch14/14.1/14.1-16-s.js
@@ -0,0 +1,23 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch14/14.1/14.1-16-s.js
+ * @description 'use strict' directive - not recognized if it follow an empty statement
+ * @noStrict
+ */
+
+
+function testcase() {
+
+  function foo()
+  {
+    ; 'use strict';
+     return (this !== undefined);
+  }
+
+  return foo.call(undefined);
+ }
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch14/14.1/14.1-17-s.js
@@ -0,0 +1,23 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch14/14.1/14.1-17-s.js
+ * @description 'use strict' directive - not recognized if it follow some other statment empty statement
+ * @noStrict
+ */
+
+function testcase() {
+
+  function foo()
+  {
+    var x;
+    'use strict';
+    return (this !== undefined);
+  }
+
+  return foo.call(undefined);
+ }
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch14/14.1/14.1-2-s.js
@@ -0,0 +1,23 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch14/14.1/14.1-2-s.js
+ * @description "use strict" directive - correct usage double quotes
+ * @noStrict
+ */
+
+
+function testcase() {
+
+  function foo()
+  {
+    "use strict";
+     return (this === undefined);
+  }
+
+  return foo.call(undefined);
+ }
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch14/14.1/14.1-3-s.js
@@ -0,0 +1,23 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch14/14.1/14.1-3-s.js
+ * @description 'use strict' directive - not recognized if it contains extra whitespace
+ * @noStrict
+ */
+
+
+function testcase() {
+
+  function foo()
+  {
+    '  use    strict   ';
+     return (this !== undefined);
+  }
+
+  return foo.call(undefined);
+ }
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch14/14.1/14.1-4-s.js
@@ -0,0 +1,24 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch14/14.1/14.1-4-s.js
+ * @description 'use strict' directive - not recognized if contains Line Continuation
+ * @noStrict
+ */
+
+
+function testcase() {
+
+  function foo()
+  {
+    'use str\
+ict';
+     return (this !== undefined);
+  }
+
+  return foo.call(undefined);
+ }
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch14/14.1/14.1-4gs.js
@@ -0,0 +1,14 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch14/14.1/14.1-4gs.js
+ * @description StrictMode - a Use Strict Directive followed by a strict mode violation
+ * @onlyStrict
+ * @negative ^((?!NotEarlyError).)*$
+ */
+"use strict";
+throw NotEarlyError;
+eval = 42;
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch14/14.1/14.1-5-s.js
@@ -0,0 +1,23 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch14/14.1/14.1-5-s.js
+ * @description 'use strict' directive - not recognized if contains a EscapeSequence
+ * @noStrict
+ */
+
+
+function testcase() {
+
+  function foo()
+  {
+    'use\u0020strict';
+     return(this !== undefined);
+  }
+
+  return foo.call(undefined);
+ }
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch14/14.1/14.1-5gs.js
@@ -0,0 +1,16 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch14/14.1/14.1-5gs.js
+ * @description StrictMode - a Use Strict Directive embedded in a directive prologue followed by a strict mode violation
+ * @onlyStrict
+ * @negative ^((?!NotEarlyError).)*$
+ */
+"a";
+"use strict";
+"c";
+throw NotEarlyError;
+eval = 42;
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch14/14.1/14.1-6-s.js
@@ -0,0 +1,23 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch14/14.1/14.1-6-s.js
+ * @description 'use strict' directive - not recognized if contains a <TAB> instead of a space
+ * @noStrict
+ */
+
+
+function testcase() {
+
+  function foo()
+  {
+    'use	strict';
+     return (this !== undefined);
+  }
+
+  return foo.call(undefined);
+ }
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch14/14.1/14.1-7-s.js
@@ -0,0 +1,23 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch14/14.1/14.1-7-s.js
+ * @description 'use strict' directive - not recognized if upper case
+ * @noStrict
+ */
+
+
+function testcase() {
+
+  function foo()
+  {
+    'Use Strict';
+     return (this !== undefined);
+  }
+
+  return foo.call(undefined);
+ }
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch14/14.1/14.1-8-s.js
@@ -0,0 +1,24 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch14/14.1/14.1-8-s.js
+ * @description 'use strict' directive - may follow other directives
+ * @noStrict
+ */
+
+
+function testcase() {
+
+  function foo()
+  {
+     "bogus directive";
+     "use strict";
+     return (this === undefined);
+  }
+
+  return foo.call(undefined);
+ }
+runTestCase(testcase);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/test262/ch14/14.1/14.1-9-s.js
@@ -0,0 +1,24 @@
+/// Copyright (c) 2012 Ecma International.  All rights reserved. 
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the 
+/// "Use Terms").   Any redistribution of this code must retain the above 
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch14/14.1/14.1-9-s.js
+ * @description 'use strict' directive - may occur multiple times
+ * @noStrict
+ */
+
+
+function testcase() {
+
+  function foo()
+  {
+     'use strict';
+     "use strict";
+     return (this === undefined);
+  }
+
+  return foo.call(undefined);
+ }
+runTestCase(testcase);
new file mode 100644
new file mode 100644
new file mode 100644
new file mode 100644
--- a/js/src/tests/update-test262.sh
+++ b/js/src/tests/update-test262.sh
@@ -76,21 +76,23 @@ cp ${tmp_dir}/LICENSE ${test262_dir}
 # doing this:
 #
 #   cp -r ${tmp_dir}/test/suite/ch* ${test262_dir}
 #
 # ...we instead individually import folders whose tests we pass.  (Well, mostly
 # pass -- see the comment at the end of this script.)
 cp -r ${tmp_dir}/test/suite/ch06 ${test262_dir}/ch06
 cp -r ${tmp_dir}/test/suite/ch07 ${test262_dir}/ch07
+cp -r ${tmp_dir}/test/suite/ch08 ${test262_dir}/ch08
 cp -r ${tmp_dir}/test/suite/ch09 ${test262_dir}/ch09
 cp -r ${tmp_dir}/test/suite/ch10 ${test262_dir}/ch10
 cp -r ${tmp_dir}/test/suite/ch11 ${test262_dir}/ch11
 cp -r ${tmp_dir}/test/suite/ch12 ${test262_dir}/ch12
 cp -r ${tmp_dir}/test/suite/ch13 ${test262_dir}/ch13
+cp -r ${tmp_dir}/test/suite/ch14 ${test262_dir}/ch14
 
 # The test402 tests are in test/suite/intl402/.  For now there are no
 # "bestPractice" tests to omit.  The remaining tests are in chNN directories,
 # NN referring to chapters of ECMA-402.
 #
 # All intl402 tests are runnable, and only a few currently fail, so we import
 # them wildcard-style.
 mkdir ${test262_dir}/intl402
--- a/js/src/vm/ArgumentsObject.cpp
+++ b/js/src/vm/ArgumentsObject.cpp
@@ -179,18 +179,22 @@ ArgumentsObject::create(JSContext *cx, H
 
     bool strict = callee->strict();
     Class *clasp = strict ? &StrictArgumentsObject::class_ : &NormalArgumentsObject::class_;
 
     RootedTypeObject type(cx, proto->getNewType(cx, clasp));
     if (!type)
         return NULL;
 
+    JSObject *metadata = NULL;
+    if (!NewObjectMetadata(cx, &metadata))
+        return NULL;
+
     RootedShape shape(cx, EmptyShape::getInitialShape(cx, clasp, TaggedProto(proto),
-                                                      proto->getParent(), NewObjectMetadata(cx), FINALIZE_KIND,
+                                                      proto->getParent(), metadata, FINALIZE_KIND,
                                                       BaseShape::INDEXED));
     if (!shape)
         return NULL;
 
     unsigned numFormals = callee->nargs;
     unsigned numDeletedWords = NumWordsForBitArrayOfLength(numActuals);
     unsigned numArgs = Max(numActuals, numFormals);
     unsigned numBytes = offsetof(ArgumentsData, args) +
--- a/js/src/vm/Stack.cpp
+++ b/js/src/vm/Stack.cpp
@@ -1211,19 +1211,18 @@ ScriptFrameIter::numFrameSlots() const
             return ionInlineFrames_.snapshotIterator().slots() - ionInlineFrames_.script()->nfixed;
         ion::BaselineFrame *frame = data_.ionFrames_.baselineFrame();
         return frame->numValueSlots() - data_.ionFrames_.script()->nfixed;
 #else
         break;
 #endif
       }
       case SCRIPTED:
-        JS_ASSERT(data_.cx_);
-        JS_ASSERT(data_.cx_->interpreterRegs().spForStackDepth(0) == interpFrame()->base());
-        return data_.cx_->interpreterRegs().sp - interpFrame()->base();
+        JS_ASSERT(data_.interpFrames_.sp() >= interpFrame()->base());
+        return data_.interpFrames_.sp() - interpFrame()->base();
     }
     JS_NOT_REACHED("Unexpected state");
     return 0;
 }
 
 Value
 ScriptFrameIter::frameSlotValue(size_t index) const
 {
--- a/js/xpconnect/src/XPCComponents.cpp
+++ b/js/xpconnect/src/XPCComponents.cpp
@@ -4289,17 +4289,20 @@ nsXPCComponents_Utils::MakeObjectPropsNo
 
 NS_IMETHODIMP
 nsXPCComponents_Utils::IsDeadWrapper(const jsval &obj, bool *out)
 {
     *out = false;
     if (JSVAL_IS_PRIMITIVE(obj))
         return NS_ERROR_INVALID_ARG;
 
-    *out = JS_IsDeadWrapper(JSVAL_TO_OBJECT(obj));
+    // Make sure to unwrap first. Once a proxy is nuked, it ceases to be a
+    // wrapper, meaning that, if passed to another compartment, we'll generate
+    // a CCW for it. Make sure that IsDeadWrapper sees through the confusion.
+    *out = JS_IsDeadWrapper(js::CheckedUnwrap(JSVAL_TO_OBJECT(obj)));
     return NS_OK;
 }
 
 /* void recomputerWrappers(jsval vobj); */
 NS_IMETHODIMP
 nsXPCComponents_Utils::RecomputeWrappers(const jsval &vobj, JSContext *cx)
 {
     // Determine the compartment of the given object, if any.
new file mode 100644
--- /dev/null
+++ b/js/xpconnect/tests/unit/test_bug885800.js
@@ -0,0 +1,13 @@
+const Cu = Components.utils;
+
+function run_test() {
+  var sb = new Cu.Sandbox('http://www.example.com');
+  var obj = Cu.evalInSandbox('this.obj = {foo: 2}; obj', sb);
+  var chromeSb = new Cu.Sandbox(this);
+  chromeSb.objRef = obj;
+  do_check_eq(Cu.evalInSandbox('objRef.foo', chromeSb), 2);
+  Cu.nukeSandbox(sb);
+  do_check_true(Cu.isDeadWrapper(obj));
+  // CCWs to nuked wrappers should be considered dead.
+  do_check_true(Cu.isDeadWrapper(chromeSb.objRef));
+}
--- a/js/xpconnect/tests/unit/xpcshell.ini
+++ b/js/xpconnect/tests/unit/xpcshell.ini
@@ -18,16 +18,17 @@ tail =
 [test_bug813901.js]
 [test_bug845201.js]
 [test_bug845862.js]
 [test_bug849730.js]
 [test_bug851895.js]
 [test_bug854558.js]
 [test_bug868675.js]
 [test_bug872772.js]
+[test_bug885800.js]
 [test_bug_442086.js]
 [test_file.js]
 [test_blob.js]
 [test_blob2.js]
 [test_file2.js]
 [test_import.js]
 [test_import_fail.js]
 [test_js_weak_references.js]
--- a/layout/build/nsLayoutModule.cpp
+++ b/layout/build/nsLayoutModule.cpp
@@ -1180,16 +1180,18 @@ static const mozilla::Module::ContractID
   { NS_FORMDATA_CONTRACTID, &kNS_FORMDATA_CID },
   { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX BLOBURI_SCHEME, &kNS_BLOBPROTOCOLHANDLER_CID },
   { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX MEDIASTREAMURI_SCHEME, &kNS_MEDIASTREAMPROTOCOLHANDLER_CID },
   { NS_XMLHTTPREQUEST_CONTRACTID, &kNS_XMLHTTPREQUEST_CID },
   { NS_EVENTSOURCE_CONTRACTID, &kNS_EVENTSOURCE_CID },
   { NS_DOMACTIVITY_CONTRACTID, &kNS_DOMACTIVITY_CID },
   { NS_DOMPARSER_CONTRACTID, &kNS_DOMPARSER_CID },
   { "@mozilla.org/dom/localStorage-manager;1", &kNS_DOMLOCALSTORAGEMANAGER_CID },
+  // Keeping the old ContractID for backward compatibility
+  { "@mozilla.org/dom/storagemanager;1", &kNS_DOMLOCALSTORAGEMANAGER_CID },
   { "@mozilla.org/dom/sessionStorage-manager;1", &kNS_DOMSESSIONSTORAGEMANAGER_CID },
   { "@mozilla.org/dom/json;1", &kNS_DOMJSON_CID },
   { "@mozilla.org/editor/texteditor;1", &kNS_TEXTEDITOR_CID },
   { INDEXEDDB_MANAGER_CONTRACTID, &kINDEXEDDB_MANAGER_CID },
   { DOMREQUEST_SERVICE_CONTRACTID, &kDOMREQUEST_SERVICE_CID },
   { QUOTA_MANAGER_CONTRACTID, &kQUOTA_MANAGER_CID },
 #ifdef MOZ_B2G_RIL
   { SYSTEMWORKERMANAGER_CONTRACTID, &kSYSTEMWORKERMANAGER_CID },
--- a/layout/tools/reftest/remotereftest.py
+++ b/layout/tools/reftest/remotereftest.py
@@ -382,16 +382,26 @@ user_pref("capability.principal.codebase
             self._devicemanager.pushDir(profileDir, options.remoteProfile)
         except devicemanager.DMError:
             print "Automation Error: Failed to copy extra files to device"
             raise
 
     def getManifestPath(self, path):
         return path
 
+    def printDeviceInfo(self, printLogcat=False):
+        try:
+            if printLogcat:
+                logcat = self._devicemanager.getLogcat(filterOutRegexps=fennecLogcatFilters)
+                print ''.join(logcat)
+            print "Device info: %s" % self._devicemanager.getInfo()
+            print "Test root: %s" % self._devicemanager.getDeviceRoot()
+        except devicemanager.DMError:
+            print "WARNING: Error getting device information"
+
     def cleanup(self, profileDir):
         # Pull results back from device
         if self.remoteLogFile and \
                 self._devicemanager.fileExists(self.remoteLogFile):
             self._devicemanager.getFile(self.remoteLogFile, self.localLogName)
         else:
             print "WARNING: Unable to retrieve log file (%s) from remote " \
                 "device" % self.remoteLogFile
@@ -469,37 +479,33 @@ def main(args):
     retVal = reftest.startWebServer(options)
     if retVal:
         return retVal
 
     procName = options.app.split('/')[-1]
     if (dm.processExist(procName)):
         dm.killProcess(procName)
 
-    print dm.getInfo()
+    reftest.printDeviceInfo()
 
 #an example manifest name to use on the cli
 #    manifest = "http://" + options.remoteWebServer + "/reftests/layout/reftests/reftest-sanity/reftest.list"
     retVal = 0
     try:
         cmdlineArgs = ["-reftest", manifest]
         if options.bootstrap:
             cmdlineArgs = []
         dm.recordLogcat()
         retVal = reftest.runTests(manifest, options, cmdlineArgs)
     except:
         print "Automation Error: Exception caught while running tests"
         traceback.print_exc()
         retVal = 1
 
     reftest.stopWebServer(options)
-    try:
-        logcat = dm.getLogcat(filterOutRegexps=fennecLogcatFilters)
-        print ''.join(logcat)
-        print dm.getInfo()
-    except devicemanager.DMError:
-        print "WARNING: Error getting device information at end of test"
+
+    reftest.printDeviceInfo(printLogcat=True)
 
     return retVal
 
 if __name__ == "__main__":
     sys.exit(main(sys.argv[1:]))
 
--- a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
+++ b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
@@ -779,27 +779,29 @@ void MediaPipelineTransmit::PipelineList
   if (chunk_remaining) {
     memcpy(samples_10ms_buffer_, samples_tmp, chunk_remaining * sizeof(int16_t));
     buffer_current_ = ch