Upstream version 7.35.139.0
[platform/framework/web/crosswalk.git] / src / v8 / test / mjsunit / regress / regress-359525.js
@@ -1,4 +1,4 @@
-// Copyright 2013 the V8 project authors. All rights reserved.
+// Copyright 2014 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-// Internal object we got from native code should not be writable,
-// configurable or enumerable. One can still change its public properties, but
-// we don't use them to do actual work.
-
-var collator = new Intl.Collator([]);
-
-// Direct write should fail.
-collator.collator = {'zzz':'some random object'};
-
-assertFalse(collator.collator.hasOwnProperty('zzz'));
-
-// Try redefining the property.
-var didThrow = false;
-try {
-  Object.defineProperty(collator, 'collator', {value: undefined});
-} catch(e) {
-  didThrow = true;
+// Test BinaryOpICStub substract
+var a;
+for (var i = 0; i < 2; i++) {
+  var x = 42 + a - {};
+  print(x);
+  a = "";
 }
-assertTrue(didThrow);
 
-// Try deleting the property.
-assertFalse(delete collator.collator);
+// Test BinaryOpICStub add
+var b = 1.4;
+var val = 0;
+var o = {valueOf:function() { val++; return 10; }};
+for (var i = 0; i < 2; i++) {
+  var x = (b + i) + o;
+  b = "";
+}
+assertEquals(val, 2);