Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(182)

Unified Diff: test/mjsunit/regress/regress-2980.js

Issue 153923005: A64: Synchronize with r17525. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/mjsunit.status ('k') | test/mjsunit/regress/regress-crbug-306220.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-2980.js
diff --git a/src/harmony-math.js b/test/mjsunit/regress/regress-2980.js
similarity index 68%
copy from src/harmony-math.js
copy to test/mjsunit/regress/regress-2980.js
index a4d3f2e8a5e9c5936630571644605402dee1199d..071a73353a79aec11091cc97c117710d2fb36414 100644
--- a/src/harmony-math.js
+++ b/test/mjsunit/regress/regress-2980.js
@@ -25,36 +25,40 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-'use strict';
-
-// ES6 draft 09-27-13, section 20.2.2.28.
-function MathSign(x) {
- x = TO_NUMBER_INLINE(x);
- if (x > 0) return 1;
- if (x < 0) return -1;
- if (x === 0) return x;
- return NAN;
-}
-
-// ES6 draft 09-27-13, section 20.2.2.34.
-function MathTrunc(x) {
- x = TO_NUMBER_INLINE(x);
- if (x > 0) return MathFloor(x);
- if (x < 0) return MathCeil(x);
- if (x === 0) return x;
- return NAN;
+function test(expected, holder) {
+ assertEquals(expected, holder.property);
}
+var holder = {}
+holder.__proto__ = null;
+holder.property = "foo";
+delete holder.property;
+test(undefined, holder);
+test(undefined, holder);
+test(undefined, holder);
+holder.property = "bar";
+test("bar", holder);
+test("bar", holder);
-function ExtendMath() {
- %CheckIsBootstrapping();
+// Now the same thing with a nontrivial prototype chain.
- // Set up the non-enumerable functions on the Math object.
- InstallFunctions($Math, DONT_ENUM, $Array(
- "sign", MathSign,
- "trunc", MathTrunc
- ));
+function test2(expected, holder) {
+ assertEquals(expected, holder.prop2);
}
-ExtendMath();
+var holder2 = {}
+holder2.prop2 = "foo";
+holder2.__proto__ = null;
+function Receiver() {}
+Receiver.prototype = holder2;
+
+var rec2 = new Receiver();
+delete holder2.prop2;
+
+test2(undefined, rec2);
+test2(undefined, rec2);
+test2(undefined, rec2);
+holder2.prop2 = "bar";
+test2("bar", rec2);
+test2("bar", rec2);
« no previous file with comments | « test/mjsunit/mjsunit.status ('k') | test/mjsunit/regress/regress-crbug-306220.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698