1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

Use a cache to minimize the number of Name objects.

This commit is contained in:
Nicholas Nethercote 2014-02-27 20:41:03 -08:00
parent cab5d7b96f
commit fdb7c218da
8 changed files with 18 additions and 14 deletions

View file

@ -198,7 +198,7 @@ describe('CipherTransformFactory', function() {
};
var map1 = {
Filter: new Name('Standard'),
Filter: Name.get('Standard'),
V: 2,
Length: 128,
O: unescape('%80%C3%04%96%91o%20sl%3A%E6%1B%13T%91%F2%0DV%12%E3%FF%5E%BB%' +
@ -211,7 +211,7 @@ describe('CipherTransformFactory', function() {
var fileID1 = unescape('%F6%C6%AF%17%F3rR%8DRM%9A%80%D1%EF%DF%18');
var map2 = {
Filter: new Name('Standard'),
Filter: Name.get('Standard'),
V: 4,
Length: 128,
O: unescape('sF%14v.y5%27%DB%97%0A5%22%B3%E1%D4%AD%BD%9B%3C%B4%A5%89u%15%' +

View file

@ -10,7 +10,7 @@ describe('obj', function() {
describe('Name', function() {
it('should retain the given name', function() {
var givenName = 'Font';
var name = new Name(givenName);
var name = Name.get(givenName);
expect(name.name).toEqual(givenName);
});
});

View file

@ -72,7 +72,7 @@ describe('util', function() {
it('handles dictionaries with type check', function() {
var dict = new Dict();
dict.set('Type', new Name('Page'));
dict.set('Type', Name.get('Page'));
expect(isDict(dict, 'Page')).toEqual(true);
});
});