Browse Source

Added failing test for dynamic properties of objects.

contingency-plan
Oskar Segersvärd 9 years ago
parent
commit
b4d26c5d85
  1. 5
      test/function/object-dynamic-properties/_config.js
  2. 3
      test/function/object-dynamic-properties/main.js
  3. 21
      test/function/object-dynamic-properties/tags.js

5
test/function/object-dynamic-properties/_config.js

@ -0,0 +1,5 @@
var assert = require('assert');
module.exports = {
description: 'dynamic object assignments should be imported'
};

3
test/function/object-dynamic-properties/main.js

@ -0,0 +1,3 @@
import tags from './tags';
assert(tags['[object Object]'], true);

21
test/function/object-dynamic-properties/tags.js

@ -0,0 +1,21 @@
// Emulates a piece of Lodash source code.
// The tag strings are not imported, and a runtime error ensues.
let objTag = '[object Object]';
let arrTag = '[object Array]';
let fnTag = '[object Function]';
let dateTag = '[object Date]';
let strTag = '[object String]';
let numTag = '[object Number]';
// Only the code below is included in the bundle.
var tags = {};
tags[objTag] = tags[arrTag] =
tags[fnTag] = tags[dateTag] = true;
tags[strTag] = tags[numTag] = false;
export default tags;
Loading…
Cancel
Save