Skip to content

Commit

Permalink
Disable polyfill unit tests Symbol#description for Edge for cases tha…
Browse files Browse the repository at this point in the history
…t aren't supported.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=249102661
  • Loading branch information
concavelenz authored and lauraharker committed May 21, 2019
1 parent bd445e7 commit f1b5f76
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions test/com/google/javascript/jscomp/runtime_tests/symbol_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
goog.module('jscomp.runtime_tests.symbol_test');

const testSuite = goog.require('goog.testing.testSuite');
const userAgent = goog.require('goog.userAgent');

const s1 = Symbol('example');
const s2 = Symbol('example');
Expand Down Expand Up @@ -59,10 +60,18 @@ testSuite({
},

testDescrption() {
assertEquals('example', s1.description);
assertEquals('example', s2.description);
assertEquals(undefined, s3.description);
assertEquals('Symbol.iterator', Symbol.iterator.description);
// There is no support for "upgrading" the native implementation
if (userAgent.EDGE && Symbol.toString().includes("[native code]")) {
assertEquals(undefined, s1.description);
assertEquals(undefined, s2.description);
assertEquals(undefined, s3.description);
assertEquals(undefined, Symbol.iterator.description);
} else {
assertEquals('example', s1.description);
assertEquals('example', s2.description);
assertEquals(undefined, s3.description);
assertEquals('Symbol.iterator', Symbol.iterator.description);
}
},

testCannotNew() {
Expand Down

0 comments on commit f1b5f76

Please sign in to comment.