jquery/test/node_smoke_tests/iterable_with_symbol_polyfill.js
Michał Gołębiowski bb026fc12c Core: Make jQuery objects iterable
Make iterating over jQuery objects possible using ES 2015 for-of:

    for ( node of $( "<div id=narwhal>" ) ) {
        console.log( node.id ); // "narwhal"
    }

Fixes gh-1693
2015-06-13 23:14:36 +02:00

14 lines
347 B
JavaScript

/* jshint esnext: true */
"use strict";
var assert = require( "assert" );
delete global.Symbol;
require( "core-js" );
assert.strictEqual( typeof Symbol, "function", "Expected Symbol to be a function" );
assert.notEqual( typeof Symbol.iterator, "symbol", "Expected Symbol.iterator to be polyfilled" );
require( "./lib/ensure_iterability" )();