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

Side by Side Diff: test/mjsunit/harmony/simd.js

Issue 1922603006: [JSON] implement indentation in the BasicJsonStringifier and expose via API. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « test/mjsunit/es6/symbols.js ('k') | test/mjsunit/json.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Flags: --harmony-simd 5 // Flags: --harmony-simd
6 // Flags: --allow-natives-syntax --expose-natives-as natives --noalways-opt 6 // Flags: --allow-natives-syntax --expose-natives-as natives --noalways-opt
7 7
8 function lanesForType(typeName) { 8 function lanesForType(typeName) {
9 // The lane count follows the first 'x' in the type name, which begins with 9 // The lane count follows the first 'x' in the type name, which begins with
10 // 'float', 'int', or 'bool'. 10 // 'float', 'int', or 'bool'.
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 assertSame(SIMD.foo, "foo"); 615 assertSame(SIMD.foo, "foo");
616 delete SIMD.foo; 616 delete SIMD.foo;
617 delete SIMD.Bool8x16; 617 delete SIMD.Bool8x16;
618 assertSame(SIMD.Bool8x16, undefined); 618 assertSame(SIMD.Bool8x16, undefined);
619 } 619 }
620 TestSIMDObject() 620 TestSIMDObject()
621 621
622 622
623 function TestStringify(expected, input) { 623 function TestStringify(expected, input) {
624 assertEquals(expected, JSON.stringify(input)); 624 assertEquals(expected, JSON.stringify(input));
625 assertEquals(expected, JSON.stringify(input, null, 0)); 625 assertEquals(expected, JSON.stringify(input, (key, value) => value));
626 assertEquals(JSON.stringify(input, null, "="),
627 JSON.stringify(input, (key, value) => value, "="));
626 } 628 }
627 629
628 TestStringify(undefined, SIMD.Float32x4(1, 2, 3, 4)); 630 TestStringify(undefined, SIMD.Float32x4(1, 2, 3, 4));
629 TestStringify('[null]', [SIMD.Float32x4(1, 2, 3, 4)]); 631 TestStringify('[null]', [SIMD.Float32x4(1, 2, 3, 4)]);
630 TestStringify('[{}]', [Object(SIMD.Float32x4(1, 2, 3, 4))]); 632 TestStringify('[{}]', [Object(SIMD.Float32x4(1, 2, 3, 4))]);
631 var simd_wrapper = Object(SIMD.Float32x4(1, 2, 3, 4)); 633 var simd_wrapper = Object(SIMD.Float32x4(1, 2, 3, 4));
632 TestStringify('{}', simd_wrapper); 634 TestStringify('{}', simd_wrapper);
633 simd_wrapper.a = 1; 635 simd_wrapper.a = 1;
634 TestStringify('{"a":1}', simd_wrapper); 636 TestStringify('{"a":1}', simd_wrapper);
OLDNEW
« no previous file with comments | « test/mjsunit/es6/symbols.js ('k') | test/mjsunit/json.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698