Skip to content

Commit ee5e690

Browse files
committed
Merge remote-tracking branch 'origin/ACP2E-4058' into PR_2025_08_04_chittima
2 parents 5f78f94 + 991e6ae commit ee5e690

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

dev/tests/js/jasmine/tests/lib/mage/requirejs/mixins.test.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* Copyright © Magento, Inc. All rights reserved.
3-
* See COPYING.txt for license details.
2+
* Copyright 2019 Adobe
3+
* All Rights Reserved.
44
*/
55

66
/* eslint max-nested-callbacks: 0 */
@@ -15,6 +15,19 @@ require.config({
1515
define(['rjsResolver', 'mixins'], function (resolver, mixins) {
1616
'use strict';
1717

18+
describe('mixins.js context behavior', function () {
19+
var defContext, unbundledContext;
20+
21+
beforeEach(function () {
22+
defContext = require.s.contexts._;
23+
unbundledContext = require.s.contexts.$;
24+
});
25+
26+
it('should copy nameToUrl from default context to unbundled context', function () {
27+
expect(unbundledContext.nameToUrl).toBe(defContext.nameToUrl);
28+
});
29+
});
30+
1831
describe('mixins module', function () {
1932
beforeEach(function (done) {
2033
spyOn(mixins, 'hasMixins').and.callThrough();

lib/web/mage/requirejs/mixins.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* Copyright © Magento, Inc. All rights reserved.
3-
* See COPYING.txt for license details.
2+
* Copyright 2015 Adobe
3+
* All Rights Reserved.
44
*/
55
define('mixins', [
66
'module'
@@ -222,6 +222,8 @@ require([
222222
return originalContextRequire(deps, callback, errback);
223223
};
224224

225+
unbundledContext.nameToUrl = defContext.nameToUrl;
226+
225227
/**
226228
* Wrap original context configuration to update unbundled context,
227229
* that way it is able to respect any changes done after mixins module has initialized.

0 commit comments

Comments
 (0)