| Index: test/intl/date-format/timezone-name.js
|
| diff --git a/src/hydrogen-dce.h b/test/intl/date-format/timezone-name.js
|
| similarity index 67%
|
| copy from src/hydrogen-dce.h
|
| copy to test/intl/date-format/timezone-name.js
|
| index 19749f279a2e1cb632ba5a300033e5a9f038638f..2ed5c1acaeeb2836b249dec903c6ac67fdb500d6 100644
|
| --- a/src/hydrogen-dce.h
|
| +++ b/test/intl/date-format/timezone-name.js
|
| @@ -25,32 +25,29 @@
|
| // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
| -#ifndef V8_HYDROGEN_DCE_H_
|
| -#define V8_HYDROGEN_DCE_H_
|
| +// Tests time zone names.
|
|
|
| -#include "hydrogen.h"
|
| +// Winter date (PST).
|
| +var winter = new Date(2013, 1, 12, 14, 42, 53, 0);
|
|
|
| -namespace v8 {
|
| -namespace internal {
|
| +// Summer date (PDT).
|
| +var summer = new Date(2013, 7, 12, 14, 42, 53, 0);
|
|
|
| -
|
| -class HDeadCodeEliminationPhase : public HPhase {
|
| - public:
|
| - explicit HDeadCodeEliminationPhase(HGraph* graph)
|
| - : HPhase("H_Dead code elimination", graph) { }
|
| -
|
| - void Run() {
|
| - MarkLiveInstructions();
|
| - RemoveDeadInstructions();
|
| - }
|
| -
|
| - private:
|
| - bool MarkLive(HValue* ref, HValue* instr);
|
| - void MarkLiveInstructions();
|
| - void RemoveDeadInstructions();
|
| +// Common flags for both formatters.
|
| +var flags = {
|
| + year: 'numeric', month: 'long', day: 'numeric',
|
| + hour : '2-digit', minute : '2-digit', second : '2-digit',
|
| + timeZone: 'America/Los_Angeles'
|
| };
|
|
|
| +flags.timeZoneName = "short";
|
| +var dfs = new Intl.DateTimeFormat('en-US', flags);
|
| +
|
| +assertTrue(dfs.format(winter).indexOf('PST') !== -1);
|
| +assertTrue(dfs.format(summer).indexOf('PDT') !== -1);
|
|
|
| -} } // namespace v8::internal
|
| +flags.timeZoneName = "long";
|
| +var dfl = new Intl.DateTimeFormat('en-US', flags);
|
|
|
| -#endif // V8_HYDROGEN_DCE_H_
|
| +assertTrue(dfl.format(winter).indexOf('Pacific Standard Time') !== -1);
|
| +assertTrue(dfl.format(summer).indexOf('Pacific Daylight Time') !== -1);
|
|
|