OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 } | 70 } |
71 function strict(s) { | 71 function strict(s) { |
72 return s.strict = 10; | 72 return s.strict = 10; |
73 } | 73 } |
74 | 74 |
75 nonstrict(object); | 75 nonstrict(object); |
76 nonstrict(object); | 76 nonstrict(object); |
77 %OptimizeFunctionOnNextCall(nonstrict); | 77 %OptimizeFunctionOnNextCall(nonstrict); |
78 result = undefined; | 78 result = undefined; |
79 nonstrict(object); | 79 nonstrict(object); |
80 // TODO(1475): Support storing to primitive values. | 80 assertEquals("object", typeof result); |
81 // This should return "object" once storing to primitive values is | |
82 // supported. | |
83 assertEquals("undefined", typeof result); | |
84 | 81 |
85 strict(object); | 82 strict(object); |
86 strict(object); | 83 strict(object); |
87 %OptimizeFunctionOnNextCall(strict); | 84 %OptimizeFunctionOnNextCall(strict); |
88 result = undefined; | 85 result = undefined; |
89 strict(object); | 86 strict(object); |
90 // TODO(1475): Support storing to primitive values. | 87 assertEquals(object, result); |
91 // This should return "object" once storing to primitive values is | |
92 // supported. | |
93 assertEquals("undefined", typeof result); | |
94 })(); | 88 })(); |
95 } | 89 } |
96 | 90 |
97 test(1, Number.prototype); | 91 test(1, Number.prototype); |
98 test("string", String.prototype); | 92 test("string", String.prototype); |
99 test(true, Boolean.prototype); | 93 test(true, Boolean.prototype); |
OLD | NEW |